How do readiness probes and graceful shutdown contribute to release reliability on Kubernetes?
AdvancedConceptRelease Engineering & Reliability Patterns
Answer
- Readiness probes keep a pod out of Service endpoints until it can serve, so rolling updates do not send traffic to pods still starting.
- Graceful shutdown: on termination Kubernetes sends SIGTERM; the app should stop accepting new work, finish in-flight requests and exit within
terminationGracePeriodSeconds. - A
preStopsleep of a few seconds covers the delay before endpoint removal propagates to kube-proxy and ingress controllers.
lifecycle:
preStop:
exec: {command: ["sleep", "10"]}
terminationGracePeriodSeconds: 40
Together with maxUnavailable: 0 and a PodDisruptionBudget, deploys and node drains cause zero errors.
More on Release Engineering & Reliability Patterns
Why are releases the biggest source of incidents, and what does SRE do about it?BeginnerWhat is a canary release?BeginnerWhat is progressive delivery?IntermediateShow an Argo Rollouts canary with a Prometheus analysis.AdvancedBlue-green vs canary: when do you choose each?IntermediateWhat are feature flags and how do they improve reliability?Beginner