CKAD Domain 2: Application Deployment
40 free practice questions for Application Deployment in the Certified Kubernetes Application Developer (CKAD) exam. Try each question first, then open "Show answer" for the correct option and explanation.
Application Deployment practice questions
-
Question 1. How is a blue/green release usually done with plain Kubernetes objects?
Show answer
Answer: B. Run both Deployments and switch the Service selector to green
Deployments have no BlueGreen strategy. You run the new version next to the old one, then change the Service selector (for example version: green) to move all traffic at once.
-
Question 2. Deployment shop-v1 has 9 replicas and shop-v2 has 1. Both have the label app=shop, which one Service selects. What is this?
Show answer
Answer: C. A canary, with about 10% of requests reaching v2
A Service balances across all Ready Pods that match its selector, so the replica ratio sets the rough traffic split.
-
Question 3. What is the main advantage of a blue/green release over a rolling update?
Show answer
Answer: B. Rollback is instant, by switching traffic back
The old version keeps running until you're confident, so rolling back is one selector change. The cost is running both versions at full size.
-
Question 4. Which Gateway API feature splits traffic 90/10 between two Services for a canary?
Show answer
Answer: C. weight values on backendRefs in an HTTPRoute
An HTTPRoute rule can list several backendRefs with weights, for example 90 and 10, independent of replica counts.
-
Question 5. Which command scales Deployment api to 5 replicas?
Show answer
Answer: C. kubectl scale deployment api --replicas=5
kubectl scale changes spec.replicas. kubectl autoscale creates a HorizontalPodAutoscaler instead.
-
Question 6. Which command pauses a Deployment's rollout so several changes can be applied as one?
Show answer
Answer: A. kubectl rollout pause deployment/web
While paused, changes to the Pod template don't trigger a rollout. kubectl rollout resume starts one rollout with all the changes.
-
Question 7. Which command restarts all Pods of a Deployment, through a rolling update, without changing its spec by hand?
Show answer
Answer: D. kubectl rollout restart deployment/web
rollout restart adds a restartedAt annotation to the Pod template, which triggers a normal rolling update. It's handy after a ConfigMap change.
-
Question 8. Which command rolls Deployment web back to revision 2 specifically?
Show answer
Answer: B. kubectl rollout undo deployment/web --to-revision=2
Without --to-revision, undo goes to the previous revision. history --revision=2 only shows the details of that revision.
-
Question 9. How can you record a reason for a change that shows in the CHANGE-CAUSE column of kubectl rollout history?
Show answer
Answer: C. Set the kubernetes.io/change-cause annotation
kubectl annotate deployment/web kubernetes.io/change-cause="..." is copied to the new revision. The old --record flag is deprecated.
-
Question 10. How many old ReplicaSets does a Deployment keep for rollbacks by default?
Show answer
Answer: C. 10
revisionHistoryLimit defaults to 10. Old ReplicaSets are scaled to zero but kept so you can roll back to them.
-
Question 11. A Deployment's rollout makes no progress for 10 minutes. What does the controller do by default?
Show answer
Answer: A. Marks it Progressing=False with ProgressDeadlineExceeded
progressDeadlineSeconds defaults to 600. Kubernetes reports the failure but doesn't roll back on its own; kubectl rollout status exits non-zero.
-
Question 12. What does minReadySeconds do in a Deployment?
Show answer
Answer: D. A new Pod must stay Ready that long to count as available
It guards against Pods that pass readiness and then crash soon after, slowing the rollout down until each Pod proves stable.
-
Question 13. A Deployment has 4 replicas, maxSurge: 25%, and maxUnavailable: 25%. What is the most Pods that can exist during a rollout?
Show answer
Answer: B. 5
25% of 4 is 1, so at most 4 + 1 = 5 Pods exist and at least 4 - 1 = 3 are available.
-
Question 14. Which change to a Deployment triggers a new rollout?
Show answer
Answer: C. Changing the container image in the Pod template
Only changes to spec.template create a new ReplicaSet and revision. Scaling and other fields are applied in place.
-
Question 15. Which DaemonSet update strategy replaces Pods only when you delete them yourself?
Show answer
Answer: C. OnDelete
With OnDelete, the template change takes effect only for Pods created after you delete the old ones. RollingUpdate is the default.
-
Question 16. What is a Helm chart?
Show answer
Answer: D. A package of templated Kubernetes manifests
A chart holds Chart.yaml, default values.yaml, and templates. Installing it renders the templates into manifests.
-
Question 17. In Helm, what is a release?
Show answer
Answer: A. An installed instance of a chart in a cluster
Each helm install creates a named release. Upgrades and rollbacks create new revisions of that release.
-
Question 18. Which command adds the chart repository https://charts.example.com under the name example?
Show answer
Answer: B. helm repo add example https://charts.example.com
After adding it, run helm repo update to refresh the local index, and install with example/<chart>.
-
Question 19. Which command searches added repositories for charts matching redis?
Show answer
Answer: C. helm search repo redis
helm search repo searches the indexes of added repositories. helm search hub searches Artifact Hub.
-
Question 20. Which command upgrades release web, or installs it if it doesn't exist yet?
Show answer
Answer: D. helm upgrade --install web example/web
helm upgrade --install (-i) is idempotent, which makes it common in CI pipelines.
-
Question 21. Which command shows the default values a chart accepts, before you install it?
Show answer
Answer: A. helm show values example/web
helm show values reads the chart's values.yaml. helm get values reads the values supplied to an installed release.
-
Question 22. Which command shows the values that were supplied when release web was installed or upgraded?
Show answer
Answer: B. helm get values web
helm get values shows user-supplied values; add --all to include the chart defaults.
-
Question 23. Which command rolls release web back to revision 3?
Show answer
Answer: C. helm rollback web 3
helm history web lists revisions. A rollback creates a new revision with the old configuration.
-
Question 24. Which command renders a chart's templates locally, without installing anything?
Show answer
Answer: D. helm template web example/web
helm template prints the rendered manifests. helm get manifest shows what an installed release deployed.
-
Question 25. Which command lists Helm releases in every namespace?
Show answer
Answer: A. helm list -A
helm list shows releases in the current namespace; -A (--all-namespaces) includes all of them.
-
Question 26. values.yaml sets replicaCount: 2. You run helm install web example/web -f values.yaml --set replicaCount=4. Which value is used?
Show answer
Answer: B. 4, because --set overrides values files
Precedence, lowest to highest: chart defaults, -f files in order, then --set values.
-
Question 27. Which command installs a chart into namespace shop, creating the namespace if it doesn't exist?
Show answer
Answer: C. helm install web example/web -n shop --create-namespace
-n sets the release namespace and --create-namespace creates it first.
-
Question 28. Which command installs version 1.4.2 of a chart rather than the latest one?
Show answer
Answer: B. helm install web example/web --version 1.4.2
--version selects the chart version (from Chart.yaml's version field), not the app version.
-
Question 29. Which file must a directory contain for kubectl apply -k to work on it?
Show answer
Answer: C. kustomization.yaml
kubectl apply -k <dir> runs Kustomize on the kustomization.yaml in that directory and applies the result.
-
Question 30. Which command prints the manifests a Kustomize directory produces, without applying them?
Show answer
Answer: A. kubectl kustomize ./overlays/prod
kubectl kustomize renders to stdout. Compare with the cluster using kubectl diff -k.
-
Question 31. In Kustomize, how does a prod overlay reuse the base manifests?
Show answer
Answer: D. It lists the base directory under resources
The overlay's kustomization.yaml lists ../../base under resources, then adds patches, a namespace, labels, or image changes.
-
Question 32. Which kustomization.yaml field changes a container image's tag without editing the Deployment file?
Show answer
Answer: C. images, with newTag
The images transformer matches by image name and can set newName, newTag, or digest.
-
Question 33. What does namePrefix: dev- do in a kustomization.yaml?
Show answer
Answer: B. Prepends dev- to the names of all resources
Kustomize also updates references, such as a Deployment's ConfigMap reference, to the prefixed names.
-
Question 34. Why does configMapGenerator add a hash suffix to the generated ConfigMap's name?
Show answer
Answer: A. A content change renames it, so Pods using it roll out
When the data changes, the name changes, Kustomize updates the Deployment's reference, and the template change triggers a rollout.
-
Question 35. Which kustomization.yaml field applies a strategic merge or JSON 6902 change to a base resource?
Show answer
Answer: D. patches
patches accepts strategic merge patches or JSON 6902 patches, inline or from files, with an optional target selector.
-
Question 36. Which kustomization.yaml field sets the namespace on every resource it outputs?
Show answer
Answer: B. namespace
namespace: prod sets metadata.namespace on all namespaced resources, overriding any value already in them.
-
Question 37. How do Helm and Kustomize differ in approach?
Show answer
Answer: C. Helm uses templates and values; Kustomize patches plain YAML
Helm renders Go templates from values and tracks releases. Kustomize layers overlays and patches on plain manifests, with no templating.
-
Question 38. Which command applies every manifest in the directory ./k8s?
Show answer
Answer: D. kubectl apply -f ./k8s/
-f accepts a directory and applies each manifest in it; add -R to recurse into subdirectories.
-
Question 39. Which command shows what would change in the cluster if a manifest were applied?
Show answer
Answer: B. kubectl diff -f app.yaml
kubectl diff does a server-side dry run and prints a diff between the live objects and the manifest.
-
Question 40. Which command blocks until Deployment web reports that it is available?
Show answer
Answer: A. kubectl wait --for=condition=Available deployment/web
kubectl wait waits for a condition on one or more objects, with --timeout to cap the wait.
CKAD, Certified Kubernetes Application Developer, and Kubernetes are trademarks of The Linux Foundation. These questions are original study material, not questions from the real exam.