k8s - container probes

From the docs:

Any code greater than or equal to 200 and less than 400 indicates success. Any other code indicates failure.

The liveness, readiness and startup probe are configured per container (not per Pod).

probe liveness readiness startup
why? when to restart a container when a container is ready to receive traffic when kubelet can start running liveness/readiness probes
when? after startupProbe and then continuously after startupProbe and then continuously after container starts / stops after success or failure
success do nothing tells the load balancer it's ready to receive traffic tells kubelet to start running liveness/readiness probes
failure container killed and restarted (see: restartPolicy) tells load balancer to stop sending traffic container killed and restarted (see: restartPolicy)
default same as success same as success same as success

diagram with the flow of all probes

k8s - container probes.png

references