fix: recover Pimox app pods
This commit is contained in:
parent
8decdef500
commit
bcae6c6bbb
|
|
@ -4,7 +4,10 @@ metadata:
|
|||
name: gitea-runner
|
||||
namespace: gitea-runner
|
||||
spec:
|
||||
replicas: 1
|
||||
# The Pimox Kubernetes cluster uses containerd workers and Kyverno hostPath
|
||||
# policy. The Docker-socket runner remains documented here, but Jeannie keeps
|
||||
# it scaled down so the homelab uses the Debian host systemd runner instead.
|
||||
replicas: 0
|
||||
selector:
|
||||
matchLabels:
|
||||
app: gitea-runner
|
||||
|
|
@ -14,7 +17,7 @@ spec:
|
|||
app: gitea-runner
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: debian
|
||||
homelab.dev/node-role: app
|
||||
tolerations:
|
||||
- key: node-role.kubernetes.io/control-plane
|
||||
operator: Exists
|
||||
|
|
@ -25,6 +28,8 @@ spec:
|
|||
containers:
|
||||
- name: runner
|
||||
image: gitea/act_runner:0.2.11
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
|
|
|
|||
|
|
@ -5949,6 +5949,31 @@ recreate_pods_for_selector() {
|
|||
fi
|
||||
}
|
||||
|
||||
ensure_deployment_container_image() {
|
||||
local namespace="$1"
|
||||
local deployment="$2"
|
||||
local container="$3"
|
||||
local image_ref="$4"
|
||||
local app="$5"
|
||||
local current_image
|
||||
|
||||
current_image="$(kubectl --kubeconfig "${KUBECONFIG_PATH}" -n "${namespace}" get deployment "${deployment}" \
|
||||
-o "jsonpath={.spec.template.spec.containers[?(@.name==\"${container}\")].image}" 2>/dev/null || true)"
|
||||
if [[ -z "${current_image}" ]]; then
|
||||
echo "Could not read image for container ${container} in deployment/${deployment} in namespace ${namespace}." >&2
|
||||
dump_argocd_debug "${app}"
|
||||
dump_namespace_debug "${namespace}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${current_image}" == "${image_ref}" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Updating deployment/${deployment} container ${container} image from ${current_image} to ${image_ref}."
|
||||
kubectl --kubeconfig "${KUBECONFIG_PATH}" -n "${namespace}" set image "deployment/${deployment}" "${container}=${image_ref}"
|
||||
}
|
||||
|
||||
refresh_argocd_application() {
|
||||
local app="$1"
|
||||
|
||||
|
|
@ -6609,6 +6634,7 @@ apps() {
|
|||
refresh_argocd_application website-production
|
||||
wait_for_namespace website-production website-production "${app_resource_wait_seconds}"
|
||||
wait_for_namespaced_resource website-production deployment php-website-deployment website-production "${app_resource_wait_seconds}"
|
||||
ensure_deployment_container_image website-production php-website-deployment php-app "${website_image_ref}" website-production
|
||||
if [[ "${website_image_built}" == "true" ]]; then
|
||||
recreate_pods_for_selector website-production app=php-website website-production
|
||||
else
|
||||
|
|
@ -6622,6 +6648,7 @@ apps() {
|
|||
refresh_argocd_application demos-static
|
||||
wait_for_namespace demos-static demos-static "${app_resource_wait_seconds}"
|
||||
wait_for_namespaced_resource demos-static deployment demos-static demos-static "${app_resource_wait_seconds}"
|
||||
ensure_deployment_container_image demos-static demos-static demos-static "${demos_image_ref}" demos-static
|
||||
if [[ "${demos_image_built}" == "true" ]]; then
|
||||
recreate_pods_for_selector demos-static app=demos-static demos-static
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue