From 2b9e34ba4a200b57acd6e194d20f4f65fcd18ec0 Mon Sep 17 00:00:00 2001 From: mr-forust Date: Sun, 27 Sep 2026 10:01:09 +0200 Subject: [PATCH] fix(k8s): add readiness probes so a bad image cannot look healthy Six of eight workloads had no readinessProbe, so a pod turned Ready the moment its process started. The verify job relies on `rollout status`, so it passed for images that crash-looped or served errors, which left the rollback safety net inert. Each probe targets the path the service is actually reached on: - homepages: / (verified 200) - error-pages: /404.html, the path Traefik's errorPages middleware requests. / returns 403 by design and would never pass. - webinar-checker: /health (verified 200). /metrics also answers, but it is a Prometheus endpoint, not a readiness signal. The two userbot deployments stay without probes: they expose no port and no session file, and the panel reaches Telegram through its own client. A truthful signal there needs a health endpoint in the app itself. --- edu_master/k8s/webinar-checker.yaml | 8 ++++++++ errorpages/k8s/error-pages.yaml | 7 +++++++ homepages/k8s/homepages.yaml | 14 ++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/edu_master/k8s/webinar-checker.yaml b/edu_master/k8s/webinar-checker.yaml index d0ef04e..e90e3e1 100644 --- a/edu_master/k8s/webinar-checker.yaml +++ b/edu_master/k8s/webinar-checker.yaml @@ -51,6 +51,14 @@ spec: - name: metrics containerPort: 8000 protocol: TCP + readinessProbe: + httpGet: + path: /health + port: metrics + periodSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 12 + initialDelaySeconds: 10 envFrom: - secretRef: name: edu-master-secrets diff --git a/errorpages/k8s/error-pages.yaml b/errorpages/k8s/error-pages.yaml index 8beb7ed..601a37d 100644 --- a/errorpages/k8s/error-pages.yaml +++ b/errorpages/k8s/error-pages.yaml @@ -31,4 +31,11 @@ spec: imagePullPolicy: Always ports: - containerPort: 80 + readinessProbe: + httpGet: + path: /404.html + port: 80 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 3 --- diff --git a/homepages/k8s/homepages.yaml b/homepages/k8s/homepages.yaml index ae6a795..b0c30f8 100644 --- a/homepages/k8s/homepages.yaml +++ b/homepages/k8s/homepages.yaml @@ -31,6 +31,13 @@ spec: imagePullPolicy: Always ports: - containerPort: 80 + readinessProbe: + httpGet: + path: / + port: 80 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 3 resources: requests: memory: "10Mi" @@ -72,6 +79,13 @@ spec: imagePullPolicy: Always ports: - containerPort: 80 + readinessProbe: + httpGet: + path: / + port: 80 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 3 resources: requests: memory: "10Mi"