Kubernetes Rollouts: Readiness, Health Checks, and Safe Deployments
Deployments are easy to start and hard to trust. Learn how readiness probes, rollout strategies, and traffic shaping keep Kubernetes services stable during real releases.
On this page
Key takeaways
- A pod is not ready until it passes the health checks the service actually needs.
- Readiness and liveness are different concerns; confusing them creates slowness and failed restarts.
- Rolling updates should be measured by service health, not just by pod count.
- Resource pressure and startup latency are where most deploy surprises come from.
- The safest platform teams use progressive delivery and explicit rollout gates.
Architecture
Kubernetes gives a deployment model for scheduling and self-healing, but it does not magically guarantee application health. The deployment controller manages replica counts and rollout progress, while the underlying service mesh or load balancer uses readiness endpoints to determine whether traffic should reach a pod. If readiness is too optimistic, traffic lands before the app is capable of serving it. If liveness is too aggressive, pods restart while the application is still recovering from a slow but valid startup sequence. Durable platform operations depend on separating these two ideas clearly.
Code examples
Readiness and startup probes
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 20
periodSeconds: 15Rolling update with maxUnavailable and maxSurge
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1Troubleshooting
Traffic is failing during deployment because readiness is too strict
no endpoints available for service app-serviceWarning Unhealthy 30s kubelet Readiness probe failed
Resolution: Use readiness checks that reflect serving capability, not container-level assumptions. A pod should become ready only after it can safely accept requests and dependencies are ready.
The app keeps restarting after deploys
Back-off restarting failed containerLiveness probe failed: HTTP 500
Resolution: If the app is under startup pressure or slow to initialize, liveness should be less aggressive. A restart loop often hides a startup misconfiguration rather than a process crash.
Edge cases
- Startup probes help avoid premature restarts on slow booting services.
- A service with a dependency on a database must include dependency readiness in the readiness signal.
- A rolling update with `maxUnavailable: 0` is safer but slower; adjust to the team’s operational tolerance.
Readiness is the coordination layer
A Kubernetes deployment is not just a rollout; it is a coordination problem. The scheduler creates pods, the kubelet watches health, and the service layer decides whether traffic should route to the pod. The piece that makes all of this safe is readiness.
If a pod is started but not ready, it should not receive traffic. If it is considered ready too early, users can hit a half-started process, a stale cache, or a failing dependency. In practice, readiness checks decide whether the deployment feels reliable or unstable.
Liveness and readiness solve different problems
A lot of platform failures come from conflating these two concepts. Liveness tells Kubernetes whether a container is still alive and should be restarted. Readiness tells the system whether traffic should flow to that container right now.
The distinction matters because an application may be alive but still not capable of serving useful traffic. For example, a service may be running, but waiting for a database migration or warming a cache. If liveness fails too aggressively, the container restarts repeatedly and never reaches a stable state.
Rollout strategies reveal the real operational risk
Kubernetes rolling updates reduce blast radius, but the strategy is only as good as the health gates. A deployment that sets maxUnavailable: 0 and maxSurge: 1 is safer than a high-risk aggressive rollout, but it is not automatically correct. The pod set needs a health check that matches the system’s dependency graph.
A production platform should treat rollout health as a service-level contract:
- old version remains serving while new version is verified;
- new traffic should only land after readiness is successful;
- failed rollouts must stop before user impact becomes severe.
Why startup time is an operational design issue
Many systems fail not because the deployment is wrong, but because the startup path is slow and the health checks are tuned without context. A container may need time to warm caches, establish connections, or run migrations. If a readiness probe is too early, the pod will be marked available before it is safe. If a liveness probe is too aggressive, restarts can create a loop that never resolves.
This is why platform teams often add startup probes for stateful or slow-starting workloads. They let the container start before the liveness gate begins checking the service aggressively.
Final guideline
Kubernetes is reliable when the deployment health model matches the service reality. Use readiness to control traffic, liveness to detect true deadlocks or crashes, and rollout policies to preserve service continuity. A healthy deployment is not just a running pod; it is a pod that is ready, stable, and safe to receive traffic.