CKAD Application Deployment Practice Question
You want to use Kustomize to apply a patch to a Deployment in the 'overlays/production' directory. Which command should you run from the kustomization directory?
⚠ Common exam trap
A common mix-up: candidates confuse `kubectl apply -k` with `kubectl apply -f` or `kustomize build`, not realizing that `-k` is the native Kustomize flag for kubectl and that `-f` does not process kustomization.yaml files.
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 apply -k overlays/production/
`kubectl apply -k` is the standard command to apply a Kustomize overlay directly from a directory. It instructs kubectl to process the kustomization.yaml file in the specified path, build the final Kubernetes resources with all patches and transformations applied, and then apply them to the cluster. This is the idiomatic way to use Kustomize with kubectl in a production overlay scenario.
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 create -k overlays/production/
Why it's wrong here
The `-k` flag is a kustomize-specific option that exists only on `kubectl apply`, not on `kubectl create`. `kubectl create` is an imperative command for creating resources from raw files or stdin, and while it supports `-f`, it has no built-in kustomize integration. Running `kubectl create -k overlays/production/` would fail with an error because the flag is unrecognized, so it cannot apply the kustomization as intended.
- ✓
kubectl apply -k overlays/production/
Why this is correct
`kubectl apply -k overlays/production/` is the correct declarative approach because the `-k` flag tells kubectl to treat the directory as a kustomization root, build the resource set defined in `kustomization.yaml`, and send the resulting resources to the API server for apply. It is a single command that natively leverages the kustomize build process inside kubectl, exactly matching the requirement to use kustomize to patch a deployment. This is the canonical way to apply an overlay in modern kubectl without extra tools or piping.
- ✗
kustomize build overlays/production/ | kubectl apply -f -
Why it's wrong here
While this pipeline does work—`kustomize build` renders the patched resources and `kubectl apply -f -` applies them from stdin—it is not a single command, which violates the question's implicit constraint. The pipe also introduces an extra step and requires the `kustomize` binary to be installed separately, whereas the integrated `kubectl apply -k` is simpler and more maintainable. The question asks for the best way to apply a kustomization, and using `-k` is more direct and idiomatic than manually building and piping.
- ✗
kubectl apply -f overlays/production/
Why it's wrong here
The `-f` flag treats the directory as a collection of raw YAML files, not as a kustomization root. When you run `kubectl apply -f overlays/production/`, kubectl will ignore `kustomization.yaml` and instead attempt to apply any regular YAML files in that directory, which usually do not exist or are just base files—so the patches defined in the overlay will never be applied. This command does not invoke kustomize at all, so it fails to apply the patch to the deployment as requested.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKAD question from scratch — 826 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD 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 CKAD exam.