
Answer-first summary for fast verification
Answer: Use a partitioned rolling update.
The requirement is to perform a phased rollout to half of the web server pods in GKE, which involves gradually updating only a subset of pods to minimize risk. Option A is correct because a partitioned rolling update, specifically using the `partition` field in a Kubernetes StatefulSet, allows precise control over which pods are updated. By setting the partition value (e.g., to 50% of the total pods), only pods with indices greater than or equal to that value are updated, enabling a canary-like deployment to exactly half the pods. This is ideal for web-based applications, even though StatefulSets are typically for stateful apps; it can be adapted here for controlled rollouts. Option B is incorrect because node taints with `NoExecute` are used to repel or evict pods from nodes based on tolerations, which is unrelated to phased rollouts and could cause unintended disruptions. Option C is incorrect because replica sets are inherently managed by Deployments in Kubernetes; specifying a replica set in the deployment doesn't enable phased rollouts—it's the default behavior for scaling, but rollouts are controlled via Deployment strategies like `maxSurge` or `maxUnavailable`, which don't target a fixed half of pods. Option D is incorrect because a StatefulSet with a parallel pod management policy allows concurrent creation or deletion of pods but doesn't control which pods receive updates; without the partition feature, it could update all pods simultaneously, defeating the phased approach.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You are preparing to deploy a new feature for a web-based application to production using Google Kubernetes Engine (GKE). You want to implement a phased rollout, exposing the feature to only half of the web server pods initially.
What steps should you take to achieve this?
A
Use a partitioned rolling update.
B
Use Node taints with NoExecute.
C
Use a replica set in the deployment specification.
D
Use a stateful set with parallel pod management policy.