Google ACE Practice Question: Ensuring Successful Operation of a Cloud Solution
You need to update the container image of a deployment named 'my-app' in GKE to a new version. Which command should you use?
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/my-app my-app-container=my-image:v2
kubectl set image updates the image of a deployment.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
kubectl apply -f updated-deployment.yaml
Why it's wrong here
kubectl apply -f updated-deployment.yaml requires a pre-modified manifest file. This is a declarative command that reconciles the file's state with the cluster, so you must manually edit the YAML to include the new image before running it. It does not accept an image flag and is not the direct, imperative command the question asks for. It may also produce unintended changes if the file is not aligned with the live resource's last-applied-configuration.
- ✗
kubectl update deployment my-app --image=my-image:v2
Why it's wrong here
kubectl update is an invalid subcommand in kubectl—no such verb exists. The correct imperative verb for modifying an image is set image, not update. Even if you meant set image, the syntax requires a container name in the form CONTAINER=IMAGE, so this command lacks that component. Running it would fail with an unknown command error, never reaching the deployment.
- ✗
kubectl edit deployment my-app --image=my-image:v2
Why it's wrong here
kubectl edit opens the deployment's manifest in an interactive editor; it does not accept an --image flag. The --image argument would be treated as an unrecognized flag, causing the command to error out before opening the editor. Even if you used the editor, it would be a manual, interactive process rather than a single nondestructive command. For an automated update, kubectl set image or kubectl patch are the appropriate choices.
- ✓
kubectl set image deployment/my-app my-app-container=my-image:v2
Why this is correct
kubectl set image deployment/my-app my-app-container=my-image:v2 is correct because it imperatively changes the image of the container named 'my-app-container' in the deployment 'my-app'. The syntax is RESOURCE_TYPE/RESOURCE_NAME CONTAINER_NAME=IMAGE, and the command triggers a rolling update by creating a new ReplicaSet and scaling it up while scaling down the old one. This is the standard kubectl command for updating a container image without modifying a manifest or entering a text editor. After running it, you can monitor progress with kubectl rollout status deployment/my-app.
Go deeper
Related to this question
Learn chapter
Deployment Manager and Terraform on GCP
Key term
Image
An image is a complete snapshot of a system's operating system, applications, and settings, used to deploy or restore computing environments quickly.
Key term
GKE
GKE is Google's managed Kubernetes service that automates deploying, scaling, and managing containerized applications in the cloud.
About these practice questions
This ACE question is part of Courseiva's 769-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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.