AKS 25 – Readiness and Liveness Probes

Readiness Probes – In Detail

Purpose and Function

Readiness probes determine if a container is ready to accept traffic. When a pod is not ready:

  • The pod’s IP is removed from the endpoints list of all Services matching the pod
  • Traffic is not routed to the pod until it passes readiness checks again
  • The pod remains running but is effectively removed from service rotation

Liveness Probes – In Detail

Purpose and Function

Liveness probes determine if a container is running properly. When a pod fails liveness checks:

  • The container is terminated and restarted according to the pod’s restart policy
  • This helps recover from deadlocks, infinite loops, and other “stuck” states
  • The container is forcibly restarted to resolve the issue

Key Differences Between Readiness and Liveness Probes

AspectReadiness ProbeLiveness Probe
PurposeDetermines if pod should receive trafficDetermines if pod should be restarted
Action on FailureRemove pod from service endpointsTerminate and restart container
Recovery MethodPod remains runningPod gets restarted
Use CaseTemporary failures, initializationPermanent failures requiring restart
ConfigurationCan have higher failure thresholdsShould have conservative thresholds
TimingCheck immediately after container startsDelay until application fully initialized
Probe EndpointOften checks external dependenciesTypically checks internal application state
successThresholdCan be > 1Always 1 (must succeed once to transition to success)

Leave a Reply

Your email address will not be published. Required fields are marked *