Bird
0
0

You want to ensure your Deployment always has exactly 3 running Pods. Which YAML snippet correctly sets this and prevents extra Pods during updates?

hard📝 Workflow Q8 of 15
Kubernetes - ReplicaSets and Deployments
You want to ensure your Deployment always has exactly 3 running Pods. Which YAML snippet correctly sets this and prevents extra Pods during updates?
Areplicas: 3\nstrategy:\n type: Recreate
Breplicas: 3\nstrategy:\n type: RollingUpdate\n rollingUpdate:\n maxSurge: 0\n maxUnavailable: 1
Creplicas: 3\nstrategy:\n type: RollingUpdate\n rollingUpdate:\n maxSurge: 1\n maxUnavailable: 0
Dreplicas: 3\nstrategy:\n type: RollingUpdate\n rollingUpdate:\n maxSurge: 2\n maxUnavailable: 2
Step-by-Step Solution
Solution:
  1. Step 1: Understand maxSurge and maxUnavailable

    maxSurge: 0 prevents extra Pods above desired count during updates.
  2. Step 2: Check YAML snippet

    replicas: 3\nstrategy:\n type: RollingUpdate\n rollingUpdate:\n maxSurge: 0\n maxUnavailable: 1 sets replicas to 3 and maxSurge to 0, maxUnavailable to 1, ensuring no extra Pods.
  3. Final Answer:

    replicas: 3 with maxSurge: 0 and maxUnavailable: 1 -> Option B
  4. Quick Check:

    maxSurge=0 prevents extra Pods during rolling update [OK]
Quick Trick: Set maxSurge: 0 to avoid extra Pods during updates [OK]
Common Mistakes:
  • Using maxSurge > 0 allows extra Pods
  • Choosing Recreate strategy which stops all Pods
  • Setting maxUnavailable too high causing downtime

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes