Docker says "healthy" and the pod continues to send broken traffic
Corré esto en cualquier clúster de Kubernetes que tenga contenedores con HEALTHCHECK definido en su Dockerfile y sin livenessProbe ni readinessProbe configurados en el manifiesto: kubectl get pods -o wide docker ps --filter "name=mi-servicio" --format "table {{.Names}} \t {{.Status}}" Vas a ver dos historias distintas. docker ps capaz dice Up 3 minutes (healthy) . Kubernetes, mientras tanto, no…
The article discusses the differences in how Docker's HEALTHCHECK feature is handled by various container orchestration systems, specifically Docker Swarm, Docker Compose, and Kubernetes. When a HEALTHCHECK is defined in a Dockerfile but no livenessProbe or readinessProbe is configured in the Kubernetes pod manifest, the kubelet is unaware of the HEALTHCHECK and considers the pod running and ready to receive traffic as soon as the process starts.
This can lead to issues, such as a pod being considered healthy by Docker but not by Kubernetes, resulting in unexpected behavior. The article concludes that defining a HEALTHCHECK in a Dockerfile is not enough in Kubernetes, and a readinessProbe must also be defined in the pod manifest.
Written by urgent.news from Dev.to's report — not a translation of it. Machine-written — may contain errors; check the original before relying on it.