Google Cloud Professional Cloud Developer — Question 57
You have an application controlled by a managed instance group. When you deploy a new version of the application, costs should be minimized and the number of instances should not increase. You want to ensure that, when each new instance is created, the deployment only continues if the new instance is healthy.
What should you do?
Answer options
- 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.
Correct answer: B
Explanation
The correct answer is B, as setting maxSurge to 0 and maxUnavailable to 1 allows for one instance to be taken down while ensuring that no additional instances are started until the current ones are verified as healthy. Option A would increase the number of instances, while options C and D do not correctly manage the health check requirements during deployment.