Free practice questions · DevOps
9 Certified Kubernetes Application Developer (CKAD) practice questions, with answers
Exam-style questions from the CertLumen course, spread over the exam's sections by their weights. Each has its answer and why. They're written for practice: never questions from the real exam.
About 15–20 hands-on tasks in a terminal, in 120 minutes. This course teaches every objective in lessons and tests what you know with multiple-choice questions and practice exams. In 45 command drills you type the real commands from memory and the site marks them. There's no terminal on this site: the labs give you tasks to run on a free local cluster (kind or minikube) with kubectl, Docker or Podman, and Helm; nothing costs money. Practise them until the commands are quick.
Question 1 · Application Design and Build
A Pod uses an image whose Dockerfile ends with USER appuser. The Pod sets securityContext.runAsNonRoot: true and fails with CreateContainerConfigError, reporting that it cannot verify the user is non-root. Which change fixes it with the least change to the policy?
- AUse a numeric UID (
USER 10001in the Dockerfile orrunAsUser: 10001in the Pod) - BRemove
runAsNonRootfrom the securityContext so the kubelet no longer checks which user runs - CSet
privileged: trueso that the container runtime can resolve the user nameappuser - DChange
imagePullPolicytoAlwaysso the image's user name is refreshed on each start
Show the answer
A. With runAsNonRoot: true the kubelet must be able to prove the UID is not 0. A name such as appuser cannot be resolved without starting the container, so use a numeric UID in the image or set runAsUser explicitly.
Question 2 · Application Design and Build
Which manifest fragment declares a native sidecar container?
- AAn entry under
spec.containerswithrestartPolicy: Always - BAn entry under
spec.initContainerswithlifecycle.postStartset - CAn entry under
spec.initContainerswithrestartPolicy: Always - DAn entry under
spec.ephemeralContainerswithsidecar: true
Show the answer
C. A native sidecar is an init container with restartPolicy: Always. It starts in init order and keeps running for the Pod's lifetime. restartPolicy on a regular container is not allowed, and there is no sidecar: true field.
Question 3 · Application Deployment
A release web was upgraded earlier with --set replicaCount=3. The developer now runs helm upgrade web repo/app --set image.tag=2.0 with no other flags. What happens to replicaCount?
- AIt returns to the chart default, because Helm starts from chart defaults plus this command's values
- BIt doubles to 6 because the values from each upgrade accumulate on top of one another
- CThe command fails with an error because
replicaCountis missing from this command - DIt stays at 3 because Helm remembers every earlier
--setand reuses it automatically
Show the answer
A. This is a classic trap. For repeatable upgrades, keep your overrides in a values file, or use --reuse-values.
Question 4 · Application Observability and Maintenance
A developer needs the current API version and group for HorizontalPodAutoscaler on the cluster they are connected to, with no internet access. Which command answers this?
- A
kubectl get hpa --api-versionand read the header line of the output - B
kubectl versionand compare the server minor version with the HPA documentation - C
kubectl api-resources | grep -i horizontalpodautoscalers - D
kubectl config viewand read the apiVersion field of the current context
Show the answer
C. kubectl api-resources lists each resource with its group/version, and kubectl api-versions lists all served group versions. kubectl explain hpa also shows GROUP, KIND and VERSION at the top.
Question 5 · Application Observability and Maintenance
A Pod named api has containers app and proxy. A developer wants the last 100 lines from proxy with timestamps. Which command is correct?
- A
kubectl logs api -c proxy --tail=100 --timestamps - B
kubectl logs api proxy --lines=100 --timestamps - C
kubectl logs api --container=app --limit=100 - D
kubectl logs proxy --pod=api --tail=100
Show the answer
A. Use -c or --container to choose a container, --tail=N for the number of lines and --timestamps for time prefixes.
Question 6 · Application Environment, Configuration and Security
A ClusterRole named view is bound to the group qa using a RoleBinding in the namespace test. What access do members of qa have?
- ARead-only access to most resources in every namespace
- BRead-only access to most resources in the
testnamespace only - CRead-only access to cluster-scoped resources such as nodes
- DNo access at all, because a RoleBinding cannot reference a ClusterRole
Show the answer
B. The scope of a grant comes from the binding: RoleBinding means one namespace, ClusterRoleBinding means all namespaces and cluster-scoped objects. ClusterRoles are reusable permission sets.
Question 7 · Application Environment, Configuration and Security
A LimitRange sets type: Container, defaultRequest: {cpu: 100m} and default: {cpu: 250m}. A Pod is created whose container has no CPU settings. What values does the container get?
- ARequest 100m and limit 250m
- BRequest 250m and limit 100m
- CRequest 100m and no limit
- DNo values, because LimitRange only validates
Show the answer
A. The naming is a frequent source of mistakes: default means default limit and defaultRequest means default request. min, max and maxLimitRequestRatio validate.
Question 8 · Services and Networking
A rule in an ingress policy contains ports with TCP 6379 but no from field. Which sources can connect to the selected Pods on TCP 6379?
- ANo source, because a rule needs
fromto allow anything - BAny source: a rule without
frommatches all peers - COnly Pods in the policy's own namespace
- DOnly the kubelet on the node
Show the answer
B. Within a rule, an omitted from/to matches every peer, and an omitted ports matches every port. Combine them deliberately.
Question 9 · Services and Networking
A Deployment's Pods are Running but one Pod's readiness probe fails. A Service selects all the Pods. What does the Service do with the failing Pod?
- AIt keeps sending traffic, and the kubelet restarts the Pod
- BIt deletes the Pod and creates a new one
- CIt leaves the Pod out of the ready endpoints until the probe succeeds
- DIt sends traffic to it, but only after sessionAffinity is cleared
Show the answer
C. The endpoint controller adds a Pod's address as ready only while its Ready condition is true. A failing readiness probe therefore removes it from load balancing without restarting it.
How ready are you?
Take ten more, weighted like the real exam, and see your score by section and a rough chance of passing. The course has 266 questions and 4 timed practice exams.
About the course · Free study guide · A question a day by email