KCNA Kubernetes Fundamentals Practice Question
A cluster administrator needs to ensure that a Deployment named 'frontend' in namespace 'web' is updated with a new image version using a rolling update strategy. The current deployment has 4 replicas. The administrator runs: kubectl set image deployment/frontend frontend=nginx:1.21 -n web. Which of the following describes the expected behavior?
⚠ Common exam trap
A common mix-up: candidates confuse the container name in the command (which must match the container name in the Deployment spec) with a generic name like 'app', leading them to incorrectly assume only a container named 'app' is affected.
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
✓
The Deployment will create a new ReplicaSet and gradually replace old pods with new ones
`kubectl set image deployment/frontend frontend=nginx:1.21 -n web` updates the container image in the Deployment's pod template, triggering a rolling update. The Deployment controller creates a new ReplicaSet with the updated image and gradually scales it up while scaling down the old ReplicaSet, ensuring zero downtime and maintaining the desired replica count of 4.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The Deployment will create a new ReplicaSet and gradually replace old pods with new ones
Why this is correct
This is the default rolling update behavior: a new ReplicaSet is created, and pods are gradually transitioned.
- ✗
All existing pods will be deleted immediately and new pods will be created with the new image
Why it's wrong here
That describes a Recreate update strategy, not the default RollingUpdate.
- ✗
The command will fail because you cannot update a Deployment using kubectl set image
Why it's wrong here
kubectl set image is a valid way to update the image of a Deployment.
- ✗
The Deployment's image will be updated, but only the container named 'app' will be affected
Why it's wrong here
The command specifies 'frontend' as the container name, not 'app'.
Go deeper
Related to this question
About these practice questions
This KCNA question is part of Courseiva's 833-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 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.