Professional Cloud Developer · Free Practice Question Medium
Question 3
Your application is running on a Google Kubernetes Engine (GKE) cluster. Whenever there is a release of a new version, the spec.template.spec.containers[0].image value is updated by the CI/CD tool to refer to the Docker image of the new application version. To deploy the change, you aim to have at least 1 replica of the new version and keep the prior replicas until the new replica is confirmed to be healthy.
What modification do you need to apply to the GKE Deployment object presented below?

- A Set the Deployment strategy to RollingUpdate with maxSurge set to 1, maxUnavailable set to 0.
- B Set the Deployment strategy to Recreate with maxSurge set to 0, maxUnavailable set to 1.
- C Set the Deployment strategy to Recreate with maxSurge set to 1, maxUnavailable set to 0.
- D Set the Deployment strategy to RollingUpdate with maxSurge set to 0, maxUnavailable set to 1.
Reveal correct answer
Correct answer: A
Explanation
For this scenario, the best option is to use RollingUpdate strategy with maxSurge set to 1 and maxUnavailable set to 0. This is because it allows for a gradual update, where new pods are added gradually and old pods are terminated gradually. This ensures that at least one replica of the new version is deployed and maintained while the previous replicas are still running. According to the Professional Google Cloud Developer documentation, the maxSurge=1 maxUnavailable=0 configuration is the simplest way to take advantage of surge upgrade, allowing only one surge node to be added to the node pool during an upgrade, and thus only upgrading one node at a time. This configuration is superior to the existing upgrade configuration (maxSurge=0 maxUnavailable=1) because it speeds up Pod restarts during upgrades while progressing conservatively. Therefore, the correct option is to use RollingUpdate with maxSurge=1 and maxUnavailable=0.Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
You must be logged in to post a comment.
