CKA Practice Exam.
Free practice test — 35 verified questions, instant feedback.
Know the exam before you sit it
the facts most prep sites buryEvery free resource for this exam
family overview →Get a free CKA study plan
A week-by-week plan plus new practice questions, straight to your inbox.
Frequently asked questions
How long is the CKA exam and how many tasks does it include?
You have 2 hours (120 minutes) to complete the CKA exam. During that time you'll work through 15–20 performance-based tasks that must be solved directly from a command line running Kubernetes on Linux — there are no multiple-choice questions. With roughly two hours for up to 20 hands-on tasks, that averages out to only a few minutes per task, so time management and speed with kubectl matter as much as knowing the answers. Practice using imperative commands and the official Kubernetes documentation (which you're allowed to consult during the exam) to move quickly.
What score do I need to pass the CKA, and how much does it cost?
You need a score of 66% or above to pass the CKA. The exam costs $445, and that price includes one free retake — so if you don't pass on your first attempt, you can sit the exam again at no additional cost. Because the free retake is built into the fee, it's reasonable to treat your first attempt partly as a diagnostic if you're on the borderline, though you should still prepare fully. Your score report is sent by email within 24 hours of completing the exam.
Which topics are covered on the CKA, and how are they weighted?
The CKA curriculum is organized into 5 domains: Cluster Architecture, Installation & Configuration (25%); Workloads & Scheduling (15%); Services & Networking (20%); Storage (10%); and Troubleshooting (30%). Troubleshooting is the most heavily weighted domain at 30%, so nearly a third of your score comes from diagnosing and fixing broken clusters, nodes, and workloads. Combined with the 25% for Cluster Architecture, Installation & Configuration, these two areas account for more than half of the exam — a strong signal to prioritize hands-on debugging and cluster-setup practice.
What Kubernetes version does the exam use, how is it proctored, and how long is the certification valid?
The CKA exam environment currently runs Kubernetes v1.35, and the published curriculum aligns with that same version — so study against v1.35 features and APIs rather than an older release. The exam is delivered online and remotely proctored through PSI's Bridge platform using the PSI Secure Browser, with the proctor monitoring you via streaming audio, video, and screen sharing. Once you pass, the CKA certification is valid for 2 years, after which you'll need to recertify to keep your credential current.
Browse all questions & answers
1. A cluster administrator wants a new control plane node's kubelet and kube-proxy to trust the API server automatically after running kubeadm join. Which artifact makes this trust possible without manual certificate exchange?
- A. A shared bootstrap token combined with the cluster CA certificate hash presented to kubeadm join
- B. An SSH key pair copied from the first control plane node
- C. A Kubernetes Secret of type kubernetes.io/basic-auth created in the default namespace
- D. A wildcard DNS record pointing to the API server load balancer
Show answer & explanation
Answer: A
kubeadm join uses a bootstrap token plus a CA certificate hash (discovery-token-ca-cert-hash) so the joining node can verify the API server and the API server can verify the joining node's TLS bootstrap request, after which the kubelet is issued a proper client certificate. SSH keys have nothing to do with Kubernetes API trust, basic-auth Secrets are not part of standard kubeadm bootstrap trust, and DNS records only route traffic, they do not establish cryptographic trust.2. During a cluster upgrade planned with kubeadm, which component version relationship must be respected to avoid an unsupported configuration?
- A. kubelet versions may be newer than the API server version by any number of minor versions
- B. kubelet on each node must not be newer than the kube-apiserver version, and should be no more than a few minor versions older
- C. kube-proxy must always be exactly two minor versions behind kubelet
- D. etcd must be upgraded only after every node's kubelet has been upgraded
Show answer & explanation
Answer: B
Kubernetes version skew policy requires kubelet to be no newer than kube-apiserver, and within the supported number of minor versions older, to guarantee API compatibility. Kubelets newer than the API server are unsupported, kube-proxy does not follow a fixed two-version offset rule, and etcd upgrades are governed by their own compatibility matrix independent of kubelet upgrade order.3. An administrator needs to back up the state of a kubeadm-managed cluster so it can be restored after a catastrophic control plane failure. What must be captured to ensure all cluster objects can be recovered?
- A. A tar archive of /var/lib/kubelet on every worker node
- B. A consistent snapshot of the etcd data store
- C. The contents of the kube-apiserver container image
- D. A copy of the kubeconfig file used by kubectl
Show answer & explanation
Answer: B
etcd is the single source of truth for all cluster state (objects, secrets, configuration), so a consistent etcdctl snapshot save is what allows full cluster restoration. Worker node kubelet directories hold only local pod state, not cluster-wide objects; the apiserver image contains no cluster data; and a kubeconfig only holds client credentials and endpoint info, not cluster state.4. A candidate applies a new taint to a control plane node so that only specific pods can be scheduled there. Which pod-side field must match the taint for scheduling to be permitted on that node?
- A. nodeSelector referencing the node's hostname label
- B. An identical toleration in the pod spec matching the taint's key, value, and effect
- C. A resource limit equal to the node's allocatable capacity
- D. An ownerReference pointing to the node object
Show answer & explanation
Answer: B
Taints repel pods unless the pod spec declares a matching toleration (same key, matching operator/value, and effect such as NoSchedule); tolerations permit scheduling but do not force it. A nodeSelector only targets nodes by label and does nothing to overcome a taint, resource limits are unrelated to taint logic, and pods do not use ownerReferences to nodes for scheduling.5. An admin wants to grant a CI/CD service account permission to create and delete Deployments only within the 'staging' namespace, and no other namespace. Which combination of objects accomplishes this correctly?
- A. A ClusterRole bound to the service account with a ClusterRoleBinding
- B. A Role scoped to the 'staging' namespace bound to the service account with a RoleBinding in that namespace
- C. A PodSecurityPolicy applied cluster-wide restricting the namespace field
- D. A NetworkPolicy limiting ingress to the staging namespace
Show answer & explanation
Answer: B
A namespaced Role paired with a RoleBinding is the correct RBAC primitive to grant permissions confined to a single namespace. A ClusterRole with a ClusterRoleBinding would grant the permission cluster-wide across all namespaces, PodSecurityPolicy (deprecated and unrelated to RBAC) governs pod security context rather than API verbs, and NetworkPolicy controls network traffic, not API authorization.6. A team wants every future Pod created in a namespace to automatically receive a specific toleration and an init container without modifying each manifest. Which mechanism is designed for this kind of automatic mutation at admission time?
- A. A LimitRange object in the namespace
- B. A MutatingAdmissionWebhook (or built-in mutating admission plugin) configured for that namespace
- C. A ResourceQuota object in the namespace
- D. A StorageClass marked as default
Show answer & explanation
Answer: B
Mutating admission webhooks intercept object creation requests and can inject or modify fields such as tolerations and init containers before persistence, which is exactly the described use case. LimitRange only constrains resource requests/limits, ResourceQuota caps aggregate resource consumption, and a default StorageClass only affects unspecified PVC storage class selection — none of these mutate arbitrary pod fields.7. An administrator inspects /etc/kubernetes/manifests/kube-apiserver.yaml on a control plane node and needs to change how long client certificates issued by the API server remain valid. What is the most direct supported approach?
- A. Edit the --client-ca-file flag to point to a different CA
- B. Modify the relevant certificate-related flags in the static pod manifest and let the kubelet restart the apiserver pod automatically
- C. Run kubectl edit deployment kube-apiserver -n kube-system
- D. Restart the kubelet service on every worker node
Show answer & explanation
Answer: B
Because kube-apiserver runs as a static pod, editing its manifest file in /etc/kubernetes/manifests triggers the local kubelet to detect the change and restart the pod with new flags — this is the supported way to change control plane component configuration in a kubeadm cluster. Changing --client-ca-file swaps the trusted CA rather than certificate validity duration, kube-apiserver is not a Deployment so 'kubectl edit deployment' would fail, and restarting worker kubelets has no effect on the control plane's static pod.8. A Deployment specifies 'replicas: 4' and a rolling update strategy with maxUnavailable=1 and maxSurge=1. During a rollout of a new image, what is the primary guarantee this strategy provides?
- A. All 4 old pods are terminated simultaneously before any new pod starts
- B. At most one pod can be unavailable and at most one extra pod can exist above the desired count at any point during the rollout
- C. The rollout pauses indefinitely until an administrator manually approves each pod replacement
- D. New pods only start after all old pods pass a readiness gate defined in a separate Job
Show answer & explanation
Answer: B
maxUnavailable and maxSurge bound how many pods can be down and how many extra can be created simultaneously during a rolling update, which is what enables zero-downtime updates for adequately replicated workloads. Simultaneous termination of all pods describes a Recreate strategy, not RollingUpdate; there is no built-in manual-approval pause without an external gate; and rolling updates do not depend on a separate Job resource for pod replacement.9. A Pod's container regularly crashes shortly after startup because a downstream dependency isn't ready yet, and Kubernetes keeps restarting it with increasing delay between attempts. What is this restart behavior called?
- A. Liveness probe failure escalation
- B. CrashLoopBackOff, where the kubelet increases the delay between restart attempts exponentially
- C. Eviction due to node pressure
- D. Preemption by a higher-priority pod
Show answer & explanation
Answer: B
CrashLoopBackOff is the kubelet's exponential backoff behavior for a container that repeatedly exits, increasing wait time between restarts up to a cap to avoid hammering the node. A liveness probe failure can trigger a restart but 'liveness probe failure escalation' is not the name of the backoff mechanism itself, node-pressure eviction removes pods rather than restarting containers in place, and preemption is about the scheduler removing lower-priority pods to fit a new one, unrelated to container crash restarts.10. A workload must run exactly one copy of a logging agent pod on every node in the cluster, including nodes added later. Which controller is purpose-built for this requirement?
- A. Deployment with replicas set to the current node count
- B. DaemonSet
- C. StatefulSet with a headless Service
- D. Job with parallelism set to the node count
Show answer & explanation
Answer: B
A DaemonSet ensures exactly one pod copy runs on each (matching) node and automatically extends to newly added nodes, which is exactly the stated requirement. A Deployment with a fixed replica count does not track node count changes and provides no per-node guarantee, StatefulSet is designed for stable identity and storage for stateful apps rather than per-node placement, and a Job runs pods to completion rather than as continuously running per-node daemons.11. A container needs a value that changes per environment (e.g., a database hostname) without rebuilding the image, and the value should be easy to update independently of the Pod spec. Which approach best fits this requirement?
- A. Hardcode the value as an environment variable directly in the container image
- B. Reference a ConfigMap key as an environment variable or mounted volume in the Pod spec
- C. Store the value in a Secret encoded only in base64 for readability
- D. Pass the value as a command-line flag to kubectl apply
Show answer & explanation
Answer: B
ConfigMaps externalize non-sensitive configuration from the image and can be referenced by Pods via env vars or volume mounts, letting the same image be reused across environments by swapping the ConfigMap. Hardcoding in the image defeats the goal of environment independence and requires rebuilds, Secrets are meant for sensitive data (base64 is encoding, not the defining reason to use a Secret) so using one for a non-sensitive hostname is not best practice, and kubectl apply flags don't persist as part of a Pod's declarative config.12. A Pod defines a container with resources.requests.cpu: 250m and resources.limits.cpu: 500m. What does this configuration mean for scheduling and runtime behavior?
- A. The scheduler guarantees exactly 500m CPU is reserved and the container is killed if it ever uses less than 250m
- B. The scheduler uses the 250m request to find a node with enough allocatable CPU, and the kernel throttles the container if it tries to exceed the 500m limit
- C. The container will be OOMKilled if it exceeds 500m CPU usage
- D. Requests and limits apply only to memory, not CPU, so this field is ignored
Show answer & explanation
Answer: B
CPU requests inform scheduling placement (finding a node with enough allocatable capacity) while CPU limits are enforced via CFS throttling rather than termination, since CPU is a compressible resource. There is no requirement to use at least the request amount, OOMKill applies to memory limit violations (an incompressible resource) not CPU, and CPU requests/limits are fully valid and commonly used fields, not memory-only.13. A Job manifest sets 'completions: 5' and 'parallelism: 2' without specifying a completion mode. What behavior should the administrator expect?
- A. 5 pods run concurrently at all times until all succeed
- B. Up to 2 pods run concurrently at a time, and the Job continues creating new pods until 5 have completed successfully in total
- C. Exactly 2 pods run once each and the Job is marked complete regardless of the completions field
- D. The Job creates 5 pods immediately and ignores the parallelism field entirely
Show answer & explanation
Answer: B
With completions and parallelism both set, the Job controller keeps at most 'parallelism' pods running concurrently while working toward the total 'completions' successful pod completions, replacing failed pods as needed. Running all 5 concurrently would ignore the parallelism cap, treating the Job as complete after only 2 successes would ignore the completions field, and parallelism is not ignored — it directly bounds concurrency.14. A cluster-internal application needs a stable virtual IP and DNS name that load-balances traffic across a dynamic set of backend Pods selected by label, without exposing it outside the cluster. Which Service type satisfies this exactly?
- A. ClusterIP
- B. NodePort
- C. LoadBalancer
- D. ExternalName
Show answer & explanation
Answer: A
ClusterIP is the default Service type providing a stable internal virtual IP and DNS name that load-balances across matching Pods, visible only within the cluster. NodePort additionally exposes a port on every node (external reachability), LoadBalancer provisions an external cloud load balancer, and ExternalName simply creates a DNS CNAME to an external name with no proxying or selector-based backend at all.15. An application Pod tries to reach another Service by its short name 'backend' instead of the fully qualified 'backend.namespace.svc.cluster.local' and it resolves correctly. What makes this possible?
- A. kube-proxy injects a HOSTS file entry for every Service into each Pod
- B. CoreDNS is configured with a search domain list in the Pod's /etc/resolv.conf that includes the Pod's namespace and cluster domain
- C. The Pod's container image bundles a static DNS zone file for the cluster
- D. NetworkPolicy objects perform name resolution as a side effect of allowing traffic
Show answer & explanation
Answer: B
Kubernetes populates each Pod's /etc/resolv.conf with search domains (namespace.svc.cluster.local, svc.cluster.local, cluster.local) so short names are expanded and resolved via CoreDNS, the cluster's DNS provider. kube-proxy handles Service IP load-balancing via iptables/IPVS rules, not DNS or hosts files; container images don't ship cluster DNS zone data; and NetworkPolicy only controls allowed traffic, it has no role in name resolution.16. By default, with no NetworkPolicy objects created in a namespace, what is the network traffic behavior between Pods in that namespace?
- A. All traffic is denied until at least one NetworkPolicy explicitly allows it
- B. All ingress and egress traffic is allowed between Pods, since Kubernetes networking is unrestricted by default
- C. Only traffic within the same Deployment is allowed by default
- D. Traffic is allowed only if both Pods share the same service account
Show answer & explanation
Answer: B
Kubernetes' default networking model is flat and permissive: without any NetworkPolicy resources selecting a Pod, all ingress and egress traffic is allowed, and policies exist to progressively restrict this. The 'deny by default' behavior only appears once a NetworkPolicy selects a Pod for a given direction; there's no default same-Deployment or same-service-account isolation built into core networking.17. A NetworkPolicy is created selecting Pods with label app=payments and specifies a single ingress rule allowing traffic from Pods labeled app=frontend on port 8080. What is the resulting effect on traffic to app=payments pods?
- A. Only ingress from app=frontend pods on port 8080 is allowed; all other ingress to those pods is now denied
- B. Egress from app=payments pods is also automatically restricted to app=frontend
- C. The policy has no effect unless a corresponding egress rule exists on the frontend pods
- D. All ingress remains allowed because NetworkPolicies only add exceptions, never restrictions
Show answer & explanation
Answer: A
Once any NetworkPolicy selects a Pod for the ingress direction, that direction becomes default-deny except for what the rules explicitly allow — here, only app=frontend on port 8080. Egress is a separate direction and is unaffected unless the policy also includes egress rules; policies apply independently per Pod selector, so a matching egress policy on the frontend side is not required for this ingress rule to take effect; and NetworkPolicies are inherently restrictive/allow-list based once applied, not purely additive to an already-open default.18. A Service of type NodePort is created for a Deployment. From outside the cluster, which of the following correctly describes how traffic reaches a backend Pod?
- A. External traffic must first pass through kube-scheduler before reaching kube-proxy
- B. A client connects to any cluster node's IP on the allocated NodePort, and kube-proxy forwards the connection to a healthy backend Pod, possibly on a different node
- C. External traffic can only reach Pods that are running on the specific node the client connects to
- D. NodePort Services require an Ingress controller to route any traffic at all
Show answer & explanation
Answer: B
NodePort opens the same port on every node; kube-proxy's rules (iptables/IPVS) forward incoming connections to any healthy matching Pod cluster-wide, regardless of which node it lives on. kube-scheduler is only involved in placing Pods, not in the data path of live traffic; NodePort does not require the traffic's destination Pod to reside on the contacted node; and NodePort works independently of any Ingress controller — Ingress is a separate, optional layer for HTTP(S) routing.19. An Ingress resource defines host-based routing rules for 'shop.example.com', but external clients report the domain does not route any traffic. What is the most likely missing piece?
- A. An Ingress controller is not deployed or not watching Ingress resources in the cluster
- B. The Ingress object must be recreated as a NodePort Service
- C. Ingress objects are automatically ignored unless TLS is configured
- D. DNS records are managed automatically by the Ingress API and never require external configuration
Show answer & explanation
Answer: A
The Ingress resource is only a routing specification; an Ingress controller (e.g., an nginx or cloud-provider controller) must be running and configured to watch and act on Ingress objects, or no traffic is ever routed. Ingress and Service are distinct resource types serving different purposes, so 'recreating as a NodePort' misunderstands the model; TLS is optional on Ingress and unrelated to whether routing occurs; and DNS records pointing to the ingress load balancer typically must be configured separately (or via external-dns), they are not automatically created by the Ingress API itself.20. A PersistentVolumeClaim requests 10Gi with accessMode ReadWriteOnce, and a matching PersistentVolume of 10Gi with the same accessMode already exists statically. What determines whether binding succeeds?
- A. Binding requires the PVC's storageClassName, accessModes, and capacity to be compatible with the PV, subject to any selector/label matching
- B. Binding is based solely on which PVC was created first in time, ignoring size or access mode
- C. PersistentVolumes can only bind to PersistentVolumeClaims in the same namespace as the PV
- D. Binding always requires a StorageClass with a provisioner, even for pre-provisioned PVs
Show answer & explanation
Answer: A
The binding process matches PVCs to PVs based on storage class, sufficient capacity, compatible access modes, and any selector/label constraints; the control loop picks the smallest suitable PV meeting these criteria. Creation order alone doesn't govern binding when multiple criteria must match; PersistentVolumes are cluster-scoped (not namespaced) so 'same namespace as the PV' is a category error; and statically provisioned PVs can bind with an empty or matching storageClassName without any provisioner being involved, since no dynamic provisioning happens in that path.21. A cluster uses a StorageClass with 'reclaimPolicy: Delete' for dynamically provisioned volumes. What happens to the underlying storage asset when the bound PersistentVolumeClaim is deleted?
- A. The PersistentVolume and its underlying storage are automatically deleted as well
- B. The PersistentVolume is retained indefinitely regardless of the reclaim policy
- C. The PersistentVolume is recycled by running a scrub Pod, a legacy option still active by default
- D. Deleting a PVC has no effect on the PersistentVolume under any reclaim policy
Show answer & explanation
Answer: A
With reclaimPolicy Delete, removing the PVC triggers deletion of both the PV object and its backing storage resource (e.g., the cloud disk), which is the default for most dynamically provisioned classes. 'Retain' is the policy that preserves the PV (and requires manual cleanup) after PVC deletion, not 'Delete'; the 'Recycle' reclaim policy is deprecated/removed in current Kubernetes and was never the default; and claiming PVC deletion never affects the PV contradicts the entire purpose of reclaim policies.22. A Pod mounts a volume backed by a PersistentVolumeClaim with accessMode ReadWriteOnce (RWO). A second Pod on a different node also references the same PVC. What should the administrator expect?
- A. Both Pods mount the volume simultaneously without restriction, since RWO only limits write access, not read access
- B. The second Pod will typically fail to schedule or mount, because RWO volumes can only be mounted read-write by a single node at a time
- C. Kubernetes automatically converts the volume to ReadWriteMany to satisfy both Pods
- D. The second Pod mounts successfully but all writes from the first Pod are silently discarded
Show answer & explanation
Answer: B
ReadWriteOnce restricts the volume to being mounted read-write by a single node at a time (and, depending on CSI driver/Kubernetes version nuances, effectively one Pod's node), so a second Pod scheduled to a different node will fail to attach/mount it. RWO is not a read-only-for-others mode; Kubernetes never silently upgrades a volume's access mode to RWX; and there is no mechanism that lets writes be silently discarded as a 'feature' of access mode conflicts — the mount attempt fails instead.23. An application needs its container's filesystem changes to persist only for the Pod's lifetime and be shared between two containers in the same Pod, without needing any external storage backend. Which volume type is appropriate?
- A. A PersistentVolumeClaim backed by network storage
- B. An emptyDir volume
- C. A hostPath volume pointing to a directory unique to one node
- D. A ConfigMap volume
Show answer & explanation
Answer: B
emptyDir is created when a Pod is assigned to a node, is shared across all containers in that Pod, and is deleted permanently when the Pod is removed, matching exactly the described transient shared-storage need with no external backend. A PVC implies persistence beyond the Pod's lifetime and requires a storage backend, hostPath ties data to a specific node's filesystem which breaks if the Pod reschedules and isn't meant for inter-container sharing per se, and a ConfigMap volume is for injecting configuration data, not for writable shared scratch space.24. A user runs 'kubectl get pods' and sees a Pod stuck in Pending state for several minutes. Which command provides the most direct explanation of why the scheduler has not placed it?
- A. kubectl logs <pod-name>
- B. kubectl describe pod <pod-name>, checking the Events section for scheduling failure reasons
- C. kubectl get nodes -o wide
- D. kubectl top pod <pod-name>
Show answer & explanation
Answer: B
kubectl describe pod surfaces the Events section, which records scheduler messages such as insufficient resources or unmatched node affinity/taints — the direct reason a Pod remains Pending. kubectl logs only returns container stdout/stderr, which doesn't exist yet for a Pod that hasn't been scheduled and started; kubectl get nodes shows node status but not why this specific Pod was rejected; and kubectl top requires the metrics server and pod to be running, neither of which applies to a Pending pod.25. A Deployment's Pods are repeatedly restarted, and 'kubectl describe pod' shows 'Liveness probe failed: HTTP probe failed with statuscode: 500'. What is the most direct interpretation of this signal?
- A. The container's readiness probe passed but its liveness probe endpoint is returning an application-level error, so the kubelet is restarting the container
- B. The node itself is unreachable and is about to be marked NotReady
- C. The container image failed to pull from the registry
- D. A NetworkPolicy is blocking all traffic to the Pod
Show answer & explanation
Answer: A
A liveness probe failure with an HTTP 500 means the kubelet successfully connected to the container's probe endpoint but the application returned a server error, causing the kubelet to consider the container unhealthy and restart it. This is unrelated to node reachability (that would show as NotReady node status, a different signal), unrelated to image pull errors (which would show as ImagePullBackOff/ErrImagePull events instead), and a NetworkPolicy blocking traffic would typically manifest as a connection timeout/refused rather than a completed HTTP request returning status 500.26. kubectl get nodes shows a worker node in state NotReady. Which of the following is the most systematic first step to diagnose the root cause?
- A. Delete and recreate the node object immediately
- B. SSH to the node and check the kubelet service status and logs (e.g., systemctl status kubelet, journalctl -u kubelet)
- C. Scale the affected Deployment to zero replicas
- D. Modify the node's taints to NoExecute to force pod eviction before investigating
Show answer & explanation
Answer: B
NotReady typically indicates the kubelet on that node has stopped reporting status (crashed, lost API connectivity, or a failed health check), so checking the kubelet's live service status and logs directly identifies the cause. Deleting the node object doesn't fix the underlying host issue and can cause unnecessary pod rescheduling churn; scaling an unrelated Deployment doesn't address node health; and manually tainting the node NoExecute before diagnosis needlessly evicts workloads that might otherwise still be running fine.27. kubectl get pods shows a Pod in ImagePullBackOff. kubectl describe pod reveals 'Failed to pull image: unauthorized: authentication required'. What is the most likely fix?
- A. Increase the Pod's memory limit
- B. Create or correct an imagePullSecrets reference in the Pod spec (or service account) with valid registry credentials
- C. Add a toleration for the NoSchedule taint
- D. Change the Pod's restartPolicy to Never
Show answer & explanation
Answer: B
An 'unauthorized' error while pulling an image means the node lacks valid credentials for the private registry, so the fix is to supply correct imagePullSecrets on the Pod or its service account. Memory limits are unrelated to registry authentication, tolerations address scheduling onto tainted nodes rather than image pull auth, and changing restartPolicy affects what happens after container exit, not the ability to pull the image in the first place.28. An application Pod cannot reach a Service by its DNS name, but curling the Service's ClusterIP directly from the same Pod works. What area should be investigated first?
- A. The kube-scheduler logs on the control plane
- B. The CoreDNS Pods' health/logs and the Pod's /etc/resolv.conf configuration
- C. The etcd cluster's disk I/O latency
- D. The container's CPU limit settings
Show answer & explanation
Answer: B
Since IP-based connectivity works but name resolution doesn't, the fault is isolated to DNS: check that CoreDNS Pods are running and healthy, and confirm the Pod's resolv.conf has correct nameserver and search entries. kube-scheduler is unrelated to runtime networking or DNS; etcd disk latency would affect API server responsiveness broadly, not selectively break DNS while ClusterIP routing works; and CPU limits on the application container wouldn't selectively break only name resolution while raw IP connectivity succeeds.29. A Deployment update introduces a broken container image, and Pods enter CrashLoopBackOff cluster-wide for that Deployment. What is the fastest supported way to restore service while investigating the image issue?
- A. kubectl rollout undo deployment/<name> to revert to the previous working ReplicaSet revision
- B. kubectl delete deployment/<name> and manually recreate Pods with kubectl run
- C. Scale the Deployment to 0 replicas and leave it there until a new image is ready
- D. Edit the Service to point selector labels at a nonexistent ReplicaSet
Show answer & explanation
Answer: A
kubectl rollout undo reverts a Deployment to its prior ReplicaSet revision using the retained rollout history, restoring known-good Pods quickly without hand-authoring new manifests. Deleting the Deployment loses its rollout history and management, and manually created Pods via kubectl run lose Deployment-level self-healing and rollout tracking; scaling to zero removes service entirely rather than restoring it; and repointing a Service's selector to a nonexistent ReplicaSet provides no functioning backend at all.30. A PersistentVolumeClaim remains stuck in Pending status indefinitely. Which combination of checks best narrows the root cause?
- A. Only checking whether the Pod referencing the PVC has a valid image tag
- B. Checking whether a matching PV exists (for static provisioning) or whether the StorageClass provisioner and CSI driver are functioning (for dynamic provisioning), plus events on the PVC
- C. Checking only the node's kubelet logs, since PVCs are node-scoped objects
- D. Checking the kube-scheduler's leader election status exclusively
Show answer & explanation
Answer: B
A stuck PVC is a storage/provisioning-layer problem: for static provisioning, verify a compatible PV exists; for dynamic provisioning, verify the StorageClass's provisioner and the underlying CSI driver are healthy, and read 'kubectl describe pvc' Events for explicit error messages. The Pod's image tag is unrelated to volume binding, which happens independently of Pod scheduling; PVCs are cluster-scoped-claim objects tied to namespaces, not to any particular node's kubelet; and scheduler leader election is unrelated to storage provisioning entirely.31. A candidate needs to drain a node for maintenance while minimizing disruption to workloads managed by a Deployment with a PodDisruptionBudget (PDB) requiring minAvailable: 2 out of 3 replicas. What happens when 'kubectl drain' is run on a node holding one of those replicas?
- A. The drain proceeds unconditionally, ignoring the PDB, because PDBs only apply to manual kubectl delete commands
- B. The eviction respects the PDB, only proceeding if evicting that Pod would not push available replicas below the minAvailable threshold
- C. The PDB blocks the drain forever regardless of how many replicas remain elsewhere
- D. PDBs apply only to StatefulSets, so this Deployment's PDB is not enforced during the drain
Show answer & explanation
Answer: B
kubectl drain uses the Eviction API, which respects PodDisruptionBudgets: an eviction is refused if it would violate minAvailable, forcing the drain to wait or retry until it's safe. PDBs are enforced specifically through the Eviction API (which drain uses), not bypassed for it; as long as other replicas remain available elsewhere satisfying minAvailable, the eviction can proceed rather than blocking forever; and PDBs apply to any pod-controller-managed workload matching their selector, including Deployments, not just StatefulSets.32. A cluster administrator wants a Pod to be scheduled preferentially on nodes with SSD-backed storage but still allow scheduling elsewhere if no SSD node is available. Which scheduling mechanism fits this requirement?
- A. A hard nodeSelector matching disktype=ssd
- B. A preferredDuringSchedulingIgnoredDuringExecution node affinity rule targeting disktype=ssd
- C. A taint with effect NoSchedule applied to non-SSD nodes
- D. A ResourceQuota limiting Pods to SSD nodes
Show answer & explanation
Answer: B
'Preferred' (soft) node affinity expresses a scheduling preference that the scheduler tries to honor via weighted scoring but does not require, allowing the Pod to still land elsewhere if no matching node exists. A plain nodeSelector is a hard requirement — the Pod stays Pending if no matching node exists; tainting non-SSD nodes would need pods to carry a toleration and still doesn't express a 'nice-to-have' preference model as flexibly; and ResourceQuota governs aggregate resource consumption per namespace, not node placement.33. A StatefulSet named 'db' with 3 replicas is deployed with a headless Service. What distinguishes the network identity of its Pods from Pods managed by a standard Deployment?
- A. StatefulSet Pods get stable, predictable hostnames (db-0, db-1, db-2) and stable DNS entries that persist across rescheduling
- B. StatefulSet Pods share a single Pod IP among all replicas
- C. StatefulSet Pods cannot be addressed via DNS at all, only by IP
- D. StatefulSet Pods are assigned random names identical in format to Deployment-managed Pods
Show answer & explanation
Answer: A
StatefulSets assign stable ordinal-based names (e.g., db-0, db-1, db-2) and, combined with a headless Service, stable per-Pod DNS records that persist across restarts/rescheduling — unlike Deployment Pods, which get random hash-suffixed names with no such per-Pod DNS guarantee. Pods never share a single IP; each Pod retains its own IP address; StatefulSet Pods are in fact addressable individually via DNS (that's the point of the headless Service), so 'cannot be addressed via DNS' is false; and the naming convention is deliberately different from and more predictable than Deployment Pod naming, not identical.34. A Pod spec includes an initContainer that runs a database schema migration before the main application container starts. What is guaranteed about the execution order and failure behavior?
- A. Init containers run concurrently with the main container to save startup time
- B. Init containers run sequentially to completion before any main container starts, and if an init container fails, the kubelet retries it according to the Pod's restart policy before the main container ever starts
- C. Init container failures are ignored and the main container starts regardless
- D. Init containers share no filesystem or volumes with the main containers
Show answer & explanation
Answer: B
Init containers run one at a time, in order, to successful completion before any app container in the Pod starts; a failing init container causes the Pod to retry that init container per the restartPolicy, blocking the main container's start until it succeeds (or the Pod is deemed failed for policies that don't retry). They do not run concurrently with the main container — that would defeat their purpose of guaranteeing pre-conditions; failures are not silently ignored; and init containers can share volumes with app containers (a common pattern for pre-populating a shared volume), so 'no shared filesystem' is incorrect.35. A cluster network uses a CNI plugin that assigns each Pod a unique IP from a cluster-wide pod CIDR. Which fundamental Kubernetes networking requirement does this directly satisfy?
- A. Every Pod can communicate with every other Pod across the cluster without NAT, since each has a routable, unique IP
- B. Every Pod must go through a NodePort to reach any other Pod
- C. Only Pods on the same node can communicate with each other
- D. Pods must share the host node's network namespace to communicate
Show answer & explanation
Answer: A
The Kubernetes networking model mandates that Pods can reach each other directly by IP across the whole cluster without NAT, and CNI plugins implement this by giving every Pod a unique, routable IP from the cluster's Pod CIDR. NodePort is for external-to-cluster access, not Pod-to-Pod communication; the flat, no-NAT model is explicitly designed to allow cross-node Pod communication (not just same-node); and Pods use their own network namespace by default (isolated from the host's), which is precisely what the CNI plugin's IP assignment supports rather than contradicts.