Docker dice "healthy" y el pod sigue mandando tráfico roto
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 headline suggests that Docker does not provide a reliable health check mechanism, and Kubernetes ignores this Docker feature. The source material explains that Kubernetes has its own set of probes for determining if a container is healthy, which are distinct from Docker's HEALTHCHECK feature. The author argues that Docker's HEALTHCHECK is more like a log with health check features rather than a true health check mechanism.
Docker only reports the health check status to Kubernetes when the container is started, and Kubernetes does not take into account Docker's HEALTHCHECK status after that. Kubernetes instead relies on its own livenessProbe, readinessProbe, and startupProbe to determine the health of a container. The author points out that there is no automatic translation between Docker's HEALTHCHECK and Kubernetes' probes, which can lead to a false sense of security in Kubernetes deployments.
The author also discusses the implications of using Docker's HEALTHCHECK in conjunction with Kubernetes' probes and Compose's depends_on: condition: service_healthy. They caution that simply exposing a /health endpoint may not provide the same level of health check functionality as Kubernetes' own probes, and that relying on Docker's HEALTHCHECK alone can lead to unexpected behavior in Kubernetes deployments.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.