
Answer-first summary for fast verification
Answer: Perform a rolling-action with maxSurge set to 0, maxUnavailable set to 1
The goal is to deploy a new version without increasing the number of instances (minimizing cost) and ensuring each new instance is healthy before proceeding. Managed Instance Groups (MIGs) use `maxSurge` and `maxUnavailable` to control rolling updates. - **maxSurge**: Determines the maximum number of new instances created **above** the desired count. Setting it to **0** ensures no extra instances are added, keeping costs low. - **maxUnavailable**: Specifies the maximum number of instances that can be temporarily **unavailable** during the update. Setting it to **1** allows one instance to be replaced at a time. With **maxSurge=0** and **maxUnavailable=1**, the MIG replaces instances one-by-one: it first stops an old instance (making it unavailable), then creates a new one in its place. The deployment waits for the new instance to be healthy before proceeding to the next replacement. This ensures no instance count increase and health checks are enforced. Options C and D are invalid as `maxHealthy`/`maxUnhealthy` are not valid parameters. Option A uses `maxSurge=1`, which increases instance count temporarily, violating the cost constraint.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You have an application running on a managed instance group. When deploying a new version, you need to minimize costs and avoid increasing the total number of instances. Additionally, the deployment should only proceed if each newly created instance passes health checks.
What is the recommended approach to achieve this?
A
Perform a rolling-action with maxSurge set to 1, maxUnavailable set to 0.
B
Perform a rolling-action with maxSurge set to 0, maxUnavailable set to 1
C
Perform a rolling-action with maxHealthy set to 1, maxUnhealthy set to 0.
D
Perform a rolling-action with maxHealthy set to 0, maxUnhealthy set to 1.