Kubectl Probes

Liveness, readiness, and startup probes that keep traffic healthy.

  • liveness probe
  • readiness probe
  • startup probe
  • health check
  • probe failed

Kubectl Probes

Liveness, readiness, and startup probes that keep traffic healthy.

Commands

CommandWhat it does
`kubectl describe pod <p>grep -A6 Probes`Read configured probes
`kubectl get events --sort-by=.lastTimestampgrep -i probe`Probe failure history
curl localhost:8080/healthzTest the health endpoint manually
kubectl logs <p> --previousLogs of the container probes killed

Example

livenessProbe:
  httpGet: {path: /healthz, port: 8080}
  periodSeconds: 10
readinessProbe:
  httpGet: {path: /readyz, port: 8080}
  periodSeconds: 5

FAQ

liveness vs readiness?

Liveness restarts broken containers; readiness only removes them from service endpoints during warmup or trouble.

Why do probes flap after deploy?

Slow cold starts: add a startupProbe (or initialDelaySeconds) so liveness does not kill warming pods.

Perguntas frequentes

liveness vs readiness?
Liveness restarts broken containers; readiness only removes them from service endpoints during warmup or trouble.
Why do probes flap after deploy?
Slow cold starts: add a startupProbe (or initialDelaySeconds) so liveness does not kill warming pods.

Kubernetes