Bird
0
0

Which of the following is the correct YAML snippet to set a rolling update strategy with maxSurge 2 and maxUnavailable 1 in a Deployment?

easy📝 Configuration Q3 of 15
Kubernetes - ReplicaSets and Deployments
Which of the following is the correct YAML snippet to set a rolling update strategy with maxSurge 2 and maxUnavailable 1 in a Deployment?
Astrategy: type: RollingUpdate maxSurge: 2 maxUnavailable: 1
Bstrategy: type: RollingUpdate rollingUpdate: maxUnavailable: 2 maxSurge: 1
Cstrategy: type: Recreate rollingUpdate: maxSurge: 2 maxUnavailable: 1
Dstrategy: type: RollingUpdate rollingUpdate: maxSurge: 2 maxUnavailable: 1
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct strategy type and nested keys

    The rolling update strategy requires type: RollingUpdate and nested rollingUpdate with maxSurge and maxUnavailable.
  2. Step 2: Check YAML structure correctness

    strategy: type: RollingUpdate rollingUpdate: maxSurge: 2 maxUnavailable: 1 correctly nests maxSurge and maxUnavailable under rollingUpdate and sets type properly.
  3. Final Answer:

    strategy: type: RollingUpdate rollingUpdate: maxSurge: 2 maxUnavailable: 1 -> Option D
  4. Quick Check:

    Correct YAML nesting for rolling update strategy [OK]
Quick Trick: maxSurge and maxUnavailable go under rollingUpdate [OK]
Common Mistakes:
  • Using Recreate type instead of RollingUpdate
  • Placing maxSurge and maxUnavailable at wrong level
  • Swapping maxSurge and maxUnavailable values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes