KCNA Kubernetes Fundamentals Practice Question
An administrator wants to perform a rolling update of a Deployment. Which TWO actions will achieve this?
⚠ Common exam trap
Candidates often confuse scaling (Option B) or deleting/recreating (Option C) with a rolling update, or think that 'rollout undo' (Option D) is a way to update to a new image, when it is actually for reverting to a previous version.
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
✓
Run 'kubectl set image deployment/myapp myapp=myapp:v2'
'kubectl set image deployment/myapp myapp=myapp:v2' directly updates the container image in the Deployment's pod template, which triggers a rolling update by default. The Deployment controller then creates a new ReplicaSet with the updated image and gradually scales it up while scaling down the old ReplicaSet, ensuring zero downtime.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Run 'kubectl set image deployment/myapp myapp=myapp:v2'
Why this is correct
This command updates the container image and triggers a rolling update.
- ✗
Run 'kubectl scale deployment myapp --replicas=0' then 'kubectl scale deployment myapp --replicas=5'
Why it's wrong here
Scaling to zero and back does not update the image; it just restarts existing pods.
- ✗
Run 'kubectl delete deployment' and then 'kubectl create deployment' with the new image
Why it's wrong here
This causes downtime; rolling update is not used.
- ✗
Run 'kubectl rollout undo deployment/myapp'
Why it's wrong here
This rolls back to a previous revision, not a rolling update to a new version.
- ✓
Edit the Deployment YAML to change the image version and run 'kubectl apply -f deployment.yaml'
Why this is correct
Applying a change to the Deployment's pod template triggers a rolling update.
Go deeper
Related to this question
About these practice questions
One of 833 original KCNA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This KCNA practice question is part of Courseiva's free CNCF 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 KCNA exam.