Implementing Zero-Downtime Deployments on EKS
Deploying code shouldn't mean taking the site offline. On Kubernetes, achieving true zero-downtime deployments requires careful configuration of health checks, readiness probes, and termination grace periods.
Table of contents:
Readiness vs Liveness
A pod might be alive but not ready to serve traffic. Configuring readiness probes correctly ensures Kubernetes only routes traffic to containers that have completely initialized.
PreStop Hooks
When a pod is terminated, it needs time to finish active requests. We use preStop hooks to gracefully drain connections before the container receives a SIGKILL.
Pod Disruption Budgets
During node upgrades, PDBs ensure that a minimum number of replicas are always available, forcing the cluster autoscaler to drain nodes slowly and safely.