Professional Cloud Developer Exam QuestionsBrowse all questions from this exam

Professional Cloud Developer Exam - Question 68


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?

Show Answer
Correct Answer: AB

To ensure that costs are minimized and the number of instances does not increase, you should perform a rolling-action with maxSurge set to 0 and maxUnavailable set to 1. This configuration ensures that no additional instances beyond the targeted number are created during the update, which keeps costs low. Setting maxUnavailable to 1 allows one instance to be taken offline and replaced, ensuring the deployment continues only if the new instance is healthy, maintaining the required instance number during the update.

Discussion

17 comments
Sign in to comment
donchickOption: B
Dec 21, 2020

B(maxSurge = 0, maxUnavailable = 1)

Ayuewinc
Apr 8, 2021

"costs should be minimized and the number of instances should not increase", maxSurge = 1 will increase the number of instances, so B would be the correct answer

syu31svcOption: B
Jul 10, 2021

"number of instances should not increase" B would be correct

celia20200410Option: A
Jul 20, 2021

ANS: A Note: If you set both maxSurge and maxUnavailable properties and both properties resolve to 0, the Updater automatically sets maxUnavailable=1, to ensure that the automated update can always proceed. https://cloud.google.com/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#max_surge Setting a higher maxSurge value speeds up your update, at the cost of additional instances, which are billed according to the Compute Engine price sheet.

morenocasadoOption: B
Mar 30, 2022

As others suggested, B is the correct option. I am adding this to highlight the community choice.

yogi_508Option: A
Apr 21, 2022

i'll go with A( number of instances should not increase--- for this number shouldn't increase than target size i think, it doesn't mean no new instances should be created, they are asking in question, like when new instance is being created, so surge >0,) https://cloud.google.com/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#max_unavailable If you do not want any unavailable machines during an update, set the maxUnavailable value to 0 and the maxSurge value to greater than 0. With these settings, Compute Engine removes each old machine only after its replacement new machine is created and running.

tomato123Option: B
Aug 20, 2022

B is correct

tab02733Option: B
Oct 11, 2022

This is the best site here. https://tech-lab.sios.jp/archives/18553 The site is in Japanese, so please translate and read it.

omermahgoubOption: A
Jan 8, 2023

the correct answer would be A. Perform a rolling-action with maxSurge set to 1, maxUnavailable set to 0. This will minimize costs by only creating one new instance at a time, and will only continue the deployment if the new instance is healthy, ensuring a consistent latency experience for end users. https://cloud.google.com/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#max_surge

omermahgoub
Jan 8, 2023

Option B is not a correct solution because setting maxSurge to 0 and maxUnavailable to 1 will not allow the deployment to continue if the new instance is not healthy. Option C is not a correct solution because maxHealthy and maxUnhealthy are not valid options for rolling-actions. Option D is not a correct solution because setting maxHealthy to 0 and maxUnhealthy to 1 will not allow the deployment to continue if the new instance is not healthy.

AeglasOption: B
Nov 24, 2023

maxSurge controls in a rolling update how many resources can be added above threshold of the MIG (managed instance group), while maxUnavailable controls the max number of instances that can be taken offline during update at the same time

santoshchauhanOption: A
Mar 8, 2024

Here's the reasoning: maxSurge: This parameter determines the number of additional instances that can be created above the target size of the instance group during the update. Setting maxSurge to 1 allows the instance group to create one extra instance beyond its target size. This extra instance is used to start a new version of your application, ensuring that there's always a running instance during the update process. maxUnavailable: This parameter specifies the number of instances that can be unavailable at any time during the update. Setting maxUnavailable to 0 ensures that there is no reduction in the number of available instances below the target size during the update process.

GCPCloudArchitectUserOption: B
Feb 27, 2022

Yes it should be B as question states deployment should stop if it is unhealthy… the only we can happen is to make it to 0 for maxSurge =1

GCPCloudArchitectUser
Feb 27, 2022

I am confused here … it’s either A or B

GCPCloudArchitectUser
Feb 27, 2022

Ok thanks for link reference Excerpt

GCPCloudArchitectUser
Feb 27, 2022

Note: If you set both maxSurge and maxUnavailable properties and both properties resolve to 0, the Updater automatically sets maxUnavailable=1, to ensure that the automated update can always proceed.

GCPCloudArchitectUser
Feb 27, 2022

That will be B

cloud_enth0325Option: B
May 31, 2022

maxSurge specifies the maximum number (or percentage) of pods above the specified number of replicas (is the maximum number of new pods that will be created at a time) and maxUnavailable is the maximum number of old pods that will be deleted at a time. maxSurge = 0 would mean no extra pods with be created.

FoxalOption: A
Feb 2, 2023

the correct answers is A

TeraflowOption: A
Mar 28, 2023

The correct answer is A. Performing a rolling update with maxSurge set to 1 and maxUnavailable set to 0 ensures that the deployment only continues if the new instance is healthy. The maxSurge parameter ensures that only one new instance is created at a time, while the maxUnavailable parameter ensures that the number of healthy instances does not decrease during the deployment. This will minimize costs by not creating unnecessary instances and will also ensure that the deployment is safe and does not impact the application's availability. Option B is incorrect because setting maxUnavailable to 1 would mean that one instance will be taken offline at a time, which could impact the application's availability during the deployment. Options C and D are incorrect because maxHealthy and maxUnhealthy are not valid parameters for a rolling update.

closer89
May 7, 2023

"costs should be minimized and the number of instances should not increase" its B with maxUnavailable=1, maxSurge=0 - you instance group will be decreased by 1 which is not prohibited

RajanOption: A
Sep 20, 2023

Option A is best suited here as if we go with option B it does not ensures that deployment only continue if the new instance is healthy.

KadhemOption: A
Nov 5, 2023

the correct answer is A i think If you do not want any unavailable machines during an update, set the maxUnavailable value to 0 and the maxSurge value to greater than 0. With these settings, Compute Engine removes each old machine only after its replacement new machine is created and running. https://cloud.google.com/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#max_surge

thewalkerOption: A
Jul 17, 2024

The correct answer is A. Perform a rolling-action with maxSurge set to 1, maxUnavailable set to 0. Here's why: Rolling Update: A rolling update is the best approach for deploying new versions of your application to a managed instance group while minimizing downtime and ensuring a smooth transition. maxSurge : This parameter controls the maximum number of instances that can be added to the group during the update. Setting maxSurge to 1 means that only one additional instance will be created beyond the target size of the group. This helps to minimize costs by avoiding unnecessary instance creation. maxUnavailable : This parameter controls the maximum number of instances that can be taken offline during the update. Setting maxUnavailable to 0 ensures that no existing instances are taken offline until the newly created instance is healthy. This guarantees that the deployment only continues if the new instance is healthy.

thewalker
Jul 17, 2024

Let's break down why the other options are incorrect: B. Perform a rolling-action with maxSurge set to 0, maxUnavailable set to 1: This would allow one instance to be taken offline before the new instance is healthy, potentially causing downtime. C. Perform a rolling-action with maxHealthy set to 1, maxUnhealthy set to 0: maxHealthy and maxUnhealthy are not valid parameters for rolling updates. They are used for regional instance group managers, not managed instance groups. D. Perform a rolling-action with maxHealthy set to 0, maxUnhealthy set to 1: Similar to option C, these parameters are not applicable to managed instance groups.