Google Associate Cloud Engineer Question 123
Single answerGoogle Cloud PlatformYou are tasked with deploying a new version of a containerized web application on Google Kubernetes Engine (GKE). The application needs to handle zero-downtime updates, and you also want to easily roll back to the previous version in case of any issues. Which GKE feature should you use to achieve this?
- A
Use a Deployment resource with RollingUpdate strategy
- B
Use a StatefulSet with OnDelete update strategy
- C
Use a DaemonSet
- D
Use a ReplicaSet directly
Show answer and explanation
Correct answer: A
Explanation
The Deployment resource in GKE is specifically designed for managing stateless applications with features like rolling updates and rollbacks. The RollingUpdate strategy ensures zero-downtime by incrementally updating pods, and in case of any issues, it's easy to revert to a previous stable version, making it ideal for this scenario.
- A. Correct.
A Deployment with RollingUpdate strategy allows zero-downtime updates by gradually replacing old pods with new ones. It also provides rollback capabilities.
- B. Incorrect.
A StatefulSet with OnDelete update strategy is designed for stateful applications and does not support automatic rolling updates.
- C. Incorrect.
A DaemonSet ensures that all or some nodes run a copy of a Pod, which is not suitable for zero-downtime updates for an entire application.
- D. Incorrect.
A ReplicaSet is a lower-level concept focused on maintaining a stable set of replica pods running at any given time and lacks direct support for rolling updates and rollbacks.