Course contentsShow
← Cloud and Infrastructure
Lesson 1173 of 2,98923. Kubernetes WorkloadsFree lesson

MinReadySeconds and Stability

Use minReadySeconds to ensure pods are stable before considering them available during rollouts.

MinReadySeconds and Stability

What you'll learn: How to use minReadySeconds to ensure pods are fully stable before Kubernetes marks them as available during rollouts.


The Problem: Premature Availability

During a rolling update, Kubernetes replaces old pods with new ones. By default, as soon as a new pod's containers start and pass readiness probes, Kubernetes considers it "available" and immediately continues rolling out or directing traffic to it. But what if your application needs a warm-up period or takes time to reach full stability?

What is MinReadySeconds?

minReadySeconds is a Deployment setting that specifies the minimum number of seconds a newly created pod must be ready (without any containers crashing) before it's considered available. This creates a stabilization period—a safety buffer to catch early failures that might not be detected by readiness probes alone.

Analogy

Think of it like a probation period for new employees. Just because someone shows up and passes initial orientation (readiness probe) doesn't mean they're fully productive. You might wait 30 days before confirming they're a good fit—minReadySeconds is that waiting period for pods.

How It Works

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  minReadySeconds: 30
  template:
    # ... pod spec

With minReadySeconds: 30, after a pod passes its readiness probe, Kubernetes waits an additional 30 seconds. If the pod stays healthy during this window, only then does it count toward the desired replica count and rollout progress.

Why It Matters

  • Catches delayed failures (memory leaks, race conditions, external dependency issues)
  • Prevents cascading failures during rollouts
  • Increases rollout safety by slowing down when problems emerge

Key Takeaway: Use minReadySeconds to add a stabilization buffer during rollouts, ensuring pods remain healthy beyond initial readiness checks before traffic shifts completely.