exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 20 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 20
Topic #: 1
[All Professional Cloud Developer Questions]

Your application is deployed in a Google Kubernetes Engine (GKE) cluster. When a new version of your application is released, your CI/CD tool updates the spec.template.spec.containers[0].image value to reference the Docker image of your new application version. When the Deployment object applies the change, you want to deploy at least 1 replica of the new version and maintain the previous replicas until the new replica is healthy.
Which change should you make to the GKE Deployment object shown below?

  • A. Set the Deployment strategy to RollingUpdate with maxSurge set to 0, maxUnavailable set to 1.
  • B. Set the Deployment strategy to RollingUpdate with maxSurge set to 1, maxUnavailable set to 0.
  • C. Set the Deployment strategy to Recreate with maxSurge set to 0, maxUnavailable set to 1.
  • D. Set the Deployment strategy to Recreate with maxSurge set to 1, maxUnavailable set to 0.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
saurabh1805
Highly Voted 3 years, 11 months ago
I will go with Option B for this. RollingUpdate: New pods are added gradually, and old pods are terminated gradually Recreate: All old pods are terminated before any new pods are added Question ask us to retain current version hence rolling update is better option here.
upvoted 18 times
...
syu31svc
Highly Voted 3 years, 4 months ago
https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades: "The simplest way to take advantage of surge upgrade is to configure maxSurge=1 maxUnavailable=0. This means that only 1 surge node can be added to the node pool during an upgrade so only 1 node will be upgraded at a time. This setting is superior to the existing upgrade configuration (maxSurge=0 maxUnavailable=1) because it speeds up Pod restarts during upgrades while progressing conservatively." Answer is B
upvoted 7 times
...
santoshchauhan
Most Recent 7 months, 3 weeks ago
Selected Answer: B
B. Set the Deployment strategy to RollingUpdate with maxSurge set to 1, maxUnavailable set to 0: maxSurge set to 1 allows the Deployment to exceed the desired number of Pods by one, permitting the creation of an additional new Pod before terminating the old ones, which aligns with the requirement. maxUnavailable set to 0 ensures that all existing Pods must remain available during the update, which again meets the requirement.
upvoted 1 times
...
theseawillclaim
8 months, 2 weeks ago
Selected Answer: B
"maxSurge=1" means that at least one VM has to stay up during the RU process.
upvoted 1 times
...
__rajan__
1 year, 1 month ago
Selected Answer: B
Option B is the correct one.
upvoted 1 times
...
omermahgoub
1 year, 10 months ago
To deploy at least 1 replica of the new version and maintain the previous replicas until the new replica is healthy, you should set the Deployment strategy to RollingUpdate with maxSurge set to 1 and maxUnavailable set to 0 (B). The RollingUpdate Deployment strategy allows you to specify the number of replicas that can be created or removed at a time as part of the update process. The maxSurge parameter specifies the maximum number of replicas that can be created in excess of the desired number of replicas, and the maxUnavailable parameter specifies the maximum number of replicas that can be unavailable at any given time. By setting maxSurge to 1 and maxUnavailable to 0, you are telling the Deployment to create at least 1 new replica of the new version and to maintain all of the previous replicas until the new replica is healthy. This will ensure that at least 1 replica of the new version is always available, while allowing the Deployment to gradually roll out the update to the rest of the replicas.
upvoted 2 times
omermahgoub
1 year, 10 months ago
The Recreate Deployment strategy (C and D) would not be suitable for this use case, as it would involve replacing all of the replicas at once, rather than rolling out the update gradually.
upvoted 1 times
...
...
tuanbo91
1 year, 10 months ago
Selected Answer: B
B is obvious
upvoted 1 times
...
jcataluna
1 year, 11 months ago
Selected Answer: B
B is correct
upvoted 1 times
...
tomato123
2 years, 2 months ago
Selected Answer: B
B is correct
upvoted 2 times
...
herocc
2 years, 9 months ago
Obviously it's B
upvoted 1 times
...
ParagSanyashiv
2 years, 9 months ago
Selected Answer: B
Answer is B
upvoted 1 times
...
ParagSanyashiv
2 years, 9 months ago
Selected Answer: B
Answer is B
upvoted 1 times
...
Flavio80
2 years, 10 months ago
the answer is B.
upvoted 1 times
...
mishsanjay
3 years, 8 months ago
Recreate can't be maintain previous replica. Answer must be B.
upvoted 3 times
...
donchick
3 years, 10 months ago
B is correct answer
upvoted 2 times
...
beranm
3 years, 10 months ago
You are not maintaining anything with Recreate strategy
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago