Courseiva

Google ACE Practice Question: Ensuring Successful Operation of a Cloud Solution

You need to perform a rolling update of a GKE deployment and ensure that during the update, the new pods are ready before terminating the old ones. You have already set the update strategy to RollingUpdate. Which kubectl command sequence should you use to update the image and monitor the rollout?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

kubectl set image deployment/myapp myapp=gcr.io/myproject/myapp:v2; kubectl rollout status deployment/myapp

kubectl set image updates the image; kubectl rollout status monitors the progress. If the rollout fails, kubectl rollout undo rolls back.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • gcloud container clusters upgrade my-cluster; kubectl get deployments

    Why it's wrong here

    This command upgrades the GKE cluster's control plane and node pools, not the application Deployment object. It is the wrong tool because it changes Kubernetes infrastructure version rather than updating myapp's container image. Plus, kubectl get deployments only lists Deployment state; it doesn't modify or verify a rollout. To update the Deployment's image you need kubectl set image or kubectl patch, not a cluster upgrade.

  • kubectl set image deployment/myapp myapp=gcr.io/myproject/myapp:v2; kubectl rollout status deployment/myapp

    Why this is correct

    kubectl set image updates the Deployment's pod template to gcr.io/myproject/myapp:v2, which triggers the Deployment controller to create a new ReplicaSet and incrementally replace old pods while respecting maxSurge/maxUnavailable. kubectl rollout status then blocks until the new ReplicaSet becomes ready and the old ReplicaSet is scaled down, confirming the rolling update completed successfully. This is the standard declarative workflow for updating an app version.

  • kubectl edit deployment myapp; kubectl get pods; kubectl delete pod old-pod

    Why it's wrong here

    kubectl edit may apply a change to the Deployment, but then you attempt to manually delete an old pod. Deleting a pod directly does not perform a controlled rolling update; the ReplicaSet will immediately recreate it from the current pod template, which could cause downtime and bypasses the Deployment's rolling update strategy. Manual pod deletion also doesn't wait for health checks or provide automated progress inspection, so it is unreliable for version updates.

  • kubectl apply -f deployment.yaml; kubectl rollout undo deployment/myapp

    Why it's wrong here

    kubectl apply -f can update the Deployment if the YAML contains a new template, but running kubectl rollout undo immediately after would revert the Deployment to the previous ReplicaSet, canceling the intended v2 rollout. This combination contradicts the desired outcome: apply starts a change, then undo rolls it back. Moreover, if the YAML lacks changes, apply will do nothing and undo would need a previous revision, so this pair is not a valid rolling update procedure.

About these practice questions

Courseiva writes every ACE question from scratch — 769 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.