Middle
What happens if the readiness probe fails?
sobes.tech AI
Answer from AI
If the readiness probe fails, Kubernetes will stop sending traffic to this pod. The pod will be excluded from the service's endpoint list. This helps prevent traffic from being sent to unhealthy or not yet ready applications, ensuring higher availability and overall stability of the service. The application inside the pod can continue to run, and Kubernetes will periodically recheck readiness. If the probe starts to succeed, the pod will be re-included in the service's endpoint list, and traffic will be directed to it again.
# Example readiness probe in Pod manifest
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15 # Delay before the first check
periodSeconds: 10 # Interval between checks
timeoutSeconds: 5 # Timeout for the check
failureThreshold: 3 # Number of failed attempts before marking the pod as not ready