CertLumen

Free practice questions · DevOps

10 Certified Kubernetes Administrator (CKA) 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.

The real exam is hands-on, not multiple choice

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 50 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 local cluster on your computer (kind or minikube; kubeadm on two VMs for the cluster-setup labs) with kubectl. Practise them until the commands are quick.

Question 1 · Cluster Architecture, Installation and Configuration

A developer has a Role that allows get, list and watch on pods in dev. She can run kubectl get pods -n dev but kubectl logs web-1 -n dev returns Forbidden. What is the minimal fix?

  1. ABind the ClusterRole cluster-admin to her with a RoleBinding in dev
  2. BAdd the create verb to the existing pods rule
  3. CAdd deployments to the Role's resources
  4. DAdd pods/log to the Role's resources with the get verb
Show the answer

D. RBAC treats sub-resources such as pods/log, pods/exec and deployments/scale as separate resources. Access to pods does not imply access to them.

Question 2 · Cluster Architecture, Installation and Configuration

A cluster's API server runs v1.37. Its worker nodes run kubelet v1.34, and the administrator wants to upgrade only the control plane this quarter. Which statement is correct under the version skew policy?

  1. AThis is supported, because kubelets may be up to three minor versions older than the API server
  2. BThis is unsupported; the kubelets must be within one minor version of the API server at all times
  3. CThis is unsupported; the kubelet must match the API server exactly
  4. DThis is supported only if kube-proxy runs a newer version than the kubelet
Show the answer

A. Kubelets can be up to three minor versions older than kube-apiserver but never newer. kubectl may differ by one minor in either direction.

Question 3 · Cluster Architecture, Installation and Configuration

A base directory defines a Deployment using image: nginx:1.25. The production overlay must run nginx:1.27 without editing the base. Which kustomization field is the simplest?

  1. AsecretGenerator: with literal image=nginx:1.27
  2. BnamePrefix: nginx-1.27-
  3. CcommonLabels: with nginx: "1.27"
  4. Dimages: with name: nginx and newTag: "1.27"
Show the answer

D. Use the images transformer in the overlay: images: [{name: nginx, newTag: "1.27"}]. Patches also work but are heavier for a tag change.

Question 4 · Workloads and Scheduling

A Deployment cannot pull an image from a private registry, and the Pods show ErrImagePull. Which solution follows Kubernetes practice?

  1. ACreate an Opaque Secret with the registry password and expose it as an environment variable in the Pod
  2. BPut the registry password into a ConfigMap and mount it as a file into every container
  3. CCreate a tls Secret from the registry certificate and mount it into the Pod as a volume
  4. DCreate a docker-registry Secret and list it in imagePullSecrets of the Pod or ServiceAccount
Show the answer

D. Image pull credentials come from a kubernetes.io/dockerconfigjson Secret, created with kubectl create secret docker-registry and listed under imagePullSecrets.

Question 5 · Services and Networking

A cluster administrator wants to define the Pod network range during installation. Which range must not overlap with the Pod CIDR?

  1. AThe container image registry subnet only
  2. BOnly the range of other namespaces
  3. CThe Service CIDR and the node network
  4. DNothing, because Pod traffic is encapsulated
Show the answer

C. The Pod CIDR, the Service CIDR (kubeadm default 10.96.0.0/12) and the node network must be distinct. An overlap breaks routing in ways that look random.

Question 6 · Services and Networking

Which statement about EndpointSlices is correct?

  1. AThey replace the deprecated Endpoints API and hold up to 100 endpoints each by default
  2. BThey must be created by hand for every Service with a selector
  3. CThey store the Service port configuration for kube-proxy in etcd only
  4. DThey are used only for headless Services
Show the answer

A. EndpointSlices (discovery.k8s.io/v1) are generated by the control plane and linked to a Service by the label kubernetes.io/service-name. The Endpoints API is deprecated.

Question 7 · Storage

A PVC uses a StorageClass with volumeBindingMode: WaitForFirstConsumer. Ten minutes after creation the claim is still Pending and kubectl describe pvc shows: waiting for first consumer to be created before binding. No Pod references the claim yet. What should the engineer do?

  1. ADelete the claim and recreate it with volumeBindingMode: Immediate in the PVC spec
  2. BRestart the CSI controller Pods because the provisioner is hung
  3. CCreate the Pod that mounts the claim; provisioning starts when it is scheduled
  4. DAdd volumeName to the claim so the control plane skips the wait
Show the answer

C. WaitForFirstConsumer delays binding and provisioning until a Pod that uses the PVC is scheduled, so the scheduler can account for topology. Pending with that event is normal and ends when a consumer exists.

Question 8 · Troubleshooting

A kubeadm join run on a new worker fails with couldn't validate the identity of the API Server several days after the cluster was created. Network connectivity to port 6443 works. What is the most likely reason?

  1. AThe Pod network CIDR overlaps with the node network, which breaks the join handshake
  2. Bkube-proxy is missing on the control plane, so the discovery request cannot be routed
  3. CThe bootstrap token has expired; generate a new join command
  4. DThe container runtime on the worker uses the cgroupfs driver instead of systemd
Show the answer

C. Run kubeadm token create --print-join-command on the control plane to get a fresh token and the correct CA hash. Tokens expire after 24 hours unless created with --ttl 0.

Question 9 · Troubleshooting

The coredns Pods are in CrashLoopBackOff. Their log contains [FATAL] plugin/loop: Loop (127.0.0.1:... -> :53) detected. What does this indicate?

  1. AThe Service CIDR is full, so CoreDNS cannot be assigned a ClusterIP and crashes during its startup
  2. BThe kube-proxy ConfigMap has the wrong clusterCIDR, so queries from CoreDNS are masqueraded incorrectly
  3. CThe Pods do not have a readiness probe, so Kubernetes restarts them as soon as they receive any query
  4. DThe upstream resolver from the node's resolv.conf points back at CoreDNS, forming a loop
Show the answer

D. Point forward in the Corefile at a real upstream (or fix the kubelet's resolvConf), then restart the CoreDNS Deployment.

Question 10 · Troubleshooting

A legacy application writes only to /var/log/app/app.log inside the container. The team wants kubectl logs to show this output without changing the application. Which design fits?

  1. ASet terminationMessagePath to the log file so that kubectl logs reads it as the container's output
  2. BRun kubectl logs --file /var/log/app/app.log to read a file inside the container through the kubelet
  3. CEnable the logToStdout field in the Pod spec so that the runtime copies the file into the stream
  4. DAdd a sidecar container that shares an emptyDir volume and runs tail -F /var/log/app/app.log
Show the answer

D. This is the streaming sidecar pattern. Alternatively, a node-level agent can collect files, or you can use kubectl exec to cat the file.

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 296 questions and 4 timed practice exams.

Take the free check

About the course · Free study guide · A question a day by email