My three-node k3s cluster on a BMAX Mini PC* had about 20 long-lived services and not a single health probe. A process that hangs instead of crashing would go undetected forever, and Kubernetes would keep routing traffic to the unresponsive pod because nothing told it “this pod is alive but broken.”
The fix sounded simple: add livenessProbe and readinessProbe to every deployment. In practice it took five batches of probes, each live-tested against the running pods, and one gotcha that put a healthy pod into a restart loop because of a Host header mismatch.
View the complete homelab infrastructure source on GitHub
The Host Header Trap
Homepage was in batch two. I added a standard httpGet probe against /api/healthcheck on port 3000. Curled it manually from a busybox pod: 200, probe works. Deployed it. Pod immediately entered a restart loop.
kubectl describe pod showed 10 readiness failures and 1 liveness failure. The probe was failing because HOMEPAGE_ALLOWED_HOSTS is set to home.woitzik.dev plus loopback, a security setting that prevents host-header-based attacks. When kubelet sends an httpGet probe, it sends the Pod IP as the Host header. Homepage’s Next.js host-validation middleware sees a bare IP in the Host header, finds it missing from the allowlist, and returns 400. Kubelet treats 400 as failure.
The fix is a Host header override on the probe, not loosening the allowlist:
livenessProbe:
httpGet:
path: /api/healthcheck
port: 3000
httpHeaders:
- name: Host
value: localhost
readinessProbe:
httpGet:
path: /api/healthcheck
port: 3000
httpHeaders:
- name: Host
value: localhost
The same issue hit Nextcloud (NEXTCLOUD_TRUSTED_DOMAINS only permits nextcloud.woitzik.dev) and Paperless (PAPERLESS_ALLOWED_HOSTS is an explicit domain/IP allowlist). All three needed a Host override: localhost for Homepage, the public hostname for Nextcloud and Paperless (see batch 5). Without it, the probes fail on a security feature doing exactly what it’s supposed to do.
If your app validates the Host header, your kubelet probes will fail without this override. It’s easy to miss, and few probe tutorials mention it.
Batch 1: Authelia, Garage, Vaultwarden
Started with the three highest-blast-radius services where the probe endpoint could be confirmed with high confidence:
- Authelia:
/api/healthon port 9091, returns{"status":"OK"}. Already the exact endpoint blackbox-exporter scrapes externally, so this was a known-good path, not a guess. - Garage: TCP-only. The image has no
wgetorcurlto verify an HTTP health path from inside the container first, so TCP probe it is. Garage’s admin API does serve/health(port 3903 by default), which makes it the candidate for a laterhttpGetupgrade. - Vaultwarden: also TCP for now. Vaultwarden does expose
/alive(its own Docker healthcheck uses it), so this one can move to anhttpGetprobe too.
# Authelia - HTTP probe, known-good endpoint
readinessProbe:
httpGet:
path: /api/health
port: 9091
initialDelaySeconds: 5
periodSeconds: 10
# Garage - TCP probe, no HTTP healthz in the image
readinessProbe:
tcpSocket:
port: 3900 # S3 API port
initialDelaySeconds: 5
periodSeconds: 10
# Vaultwarden - TCP probe, same reasoning
readinessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 5
periodSeconds: 10
All three were live-tested by temporarily pausing ArgoCD’s selfHeal, applying the probes, confirming READY 1/1 with zero restarts, then restoring selfHeal.
Batch 2: Cloudflared, Gitea, Headscale, Home Assistant, Homepage
I tested each endpoint against the running pod, via port-forward or in-container curl, before writing the probe:
- cloudflared:
/readyon its metrics port (20241). It returns 200 only while at least one tunnel connection is up, so it catches a process that’s alive but has lost its tunnel to Cloudflare’s edge. Required adding--metrics 0.0.0.0:20241so the endpoint listens on the Pod IP, which is where kubelet connects. - gitea:
/api/healthz→{"status":"pass"} - headscale:
/healthon the HTTP port →{"status":"pass"} - home-assistant:
/manifest.json, public, no auth token needed unlike/api/*, returns 200 once the frontend is serving - homepage:
/api/healthcheck→"up"(with theHost: localhostoverride from the gotcha above)
Each got generous initialDelaySeconds and failureThreshold values to avoid flapping during normal startup. Home Assistant in particular can take 30+ seconds to initialize its integrations.
Batch 3: Keel, Mealie, MySpeed, SearXNG, Uptime Kuma
All tested via Pod IP using a temporary busybox pod or a same-namespace pod’s wget, not localhost:
- keel:
/healthz→ 200, empty body - mealie:
/api/app/about→ public JSON, no auth needed - myspeed:
/→ 200 frontend HTML - searxng:
/→ 200 search page HTML, no host-validation issue - uptime-kuma:
/→ 302 redirect to/dashboardthen 200. Kubelet’s httpGet probe treats any200 <= code < 400as success, so the redirect itself passes.
The lesson from Homepage: always test probes via Pod IP, not localhost. A probe that works with curl localhost:3000 inside the container might fail when kubelet hits the Pod IP, because the app sees a different Host header.
Batch 4: Immich Stack
Immich had zero probes across all four workloads: postgres, valkey, server, and ml. One logical stack, so I fixed all four together:
- immich-postgres:
pg_isready -U immich→ accepting connections - immich-valkey:
valkey-cli ping→ PONG - immich-server:
/api/server/ping→{"res":"pong"}, no auth required - immich-ml:
/ping→pong. LongerinitialDelaySecondssince CLIP and face-detection models load into memory on startup before this endpoint responds.
Batch 5: Nextcloud, Paperless, Open WebUI
The final batch, same Host header gotcha as Homepage:
- postgres-nextcloud:
pg_isready→ accepting connections - redis-nextcloud:
redis-cli ping→ PONG - nextcloud:
/status.php,Host: nextcloud.woitzik.devoverride (NEXTCLOUD_TRUSTED_DOMAINS only permits that domain) - postgres-paperless:
pg_isready→ accepting connections - redis-paperless:
redis-cli ping→ PONG - paperless:
/api/,Host: docs.woitzik.devoverride. Returns302toschema/view/, which is a valid pass (200 <= code < 400). - paperless-gotenberg:
/health→ real component-status JSON - paperless-tika:
/→ 200 index page (no lighter healthz in this version) - open-webui:
/health→{"status":true} - paperless-gpt:
/→ 200 frontend HTML. No k8s Service exists for this one, but probes work via Pod IP regardless.
The Pattern
Every probe was live-tested against the running pod before committing, instead of copied from docs or README files. The endpoint, the expected response, and the Host header behavior were all confirmed against the real deployment.
For PostgreSQL, pg_isready is the standard probe. For Redis/Valkey, redis-cli ping or valkey-cli ping. For HTTP services, find the lightest public endpoint that doesn’t require authentication. If the app validates Host headers, add the override instead of widening the allowlist.
The initialDelaySeconds and failureThreshold values vary per service. Home Assistant needs 30+ seconds. Immich ML needs time for model loading. Authelia is fast. Copy-pasting the same probe config across all deployments is how you get false-positive restart loops.
Azure has the same problem. Application Gateway health probes need the right host name too, or a backend with host validation fails them, and every probe there or in AKS only works if you know what “healthy” means for that specific service. A generic HTTP 200 check doesn’t tell you.