CNCF CKA Practice Test 31
Question 300
Consider the following Kubernetes administration case: A container enters CrashLoopBackOff and lastState terminated reason is OOMKilled. Which principle BEST explains the intended solution?
- Node authorization depends on valid client identity and trusted CA chain.
- Exceeding a memory limit can cause OOM termination and repeated restarts.
- NetworkPolicies are additive allow lists once isolation applies.
- TLS validation requires matching server identity and trusted certificate chain.
Explanation
Correct Answer
B:Exceeding a memory limit can cause OOM termination and repeated restarts. This principle explains the targeted result. A concrete response is: Investigate memory consumption and set appropriate requests, limits or fix the application's memory use.
Incorrect Answers
A:This principle is useful for another case (Kubelet logs show TLS certificate errors after a node credential rotation.), but does not explain the most direct solution here. Exceeding a memory limit can cause OOM termination and repeated restarts.
C:NetworkPolicies are additive allow lists once isolation applies. This principle is useful for another case (After a default-deny NetworkPolicy, a required API-to-database connection times out.), but does not explain the most direct solution here. The governing consideration is: Exceeding a memory limit can cause OOM termination and repeated restarts.
D:This principle is useful for another case (A control-plane certificate replacement causes clients to reject the API server.), but does not explain the most direct solution here. Exceeding a memory limit can cause OOM termination and repeated restarts.
Question 301
A Kubernetes operator wants to verify this condition: A newly deployed app repeatedly exits with invalid configuration errors. Which investigation step is BEST suited to the case?
- Use kubectl logs pod-name --previous -c app and inspect referenced ConfigMaps.
- Inspect kubectl describe pod events and Secret existence without exposing data.
- Read kubectl describe pod Last State Reason and container memory usage.
- Inspect kubectl describe pod image pull events and verify image name and pull Secret.
Explanation
Correct Answer
A:Use kubectl logs pod-name --previous -c app and inspect referenced ConfigMaps. This diagnostic examines the relevant resource or subsystem. CrashLoopBackOff is a symptom; process exit messages reveal the cause. The validating result would be: Container starts and readiness recovers without repeated exits.
Incorrect Answers
B:This check is appropriate to the separate problem (A Deployment's Pods report CreateContainerConfigError due to a missing Secret.), but it is not the direct diagnostic for the described failure. Use kubectl logs pod-name --previous -c app and inspect referenced ConfigMaps.
C:This check is appropriate to the separate problem (A container enters CrashLoopBackOff and lastState terminated reason is OOMKilled.), but it is not the direct diagnostic for the described failure.
D:This check is appropriate to the separate problem (Pods stay ImagePullBackOff after a private registry migration.), but it is not the direct diagnostic for the described failure. Use kubectl logs pod-name --previous -c app and inspect referenced ConfigMaps.
Question 302
During an operational review, this fact emerges: After a malformed YAML edit, kubelet stops running kube-controller-manager. Which Kubernetes behavior MOST directly governs the result?
- Invalid static Pod manifests prevent kubelet from reconciling critical control-plane components.
- TLS validation requires matching server identity and trusted certificate chain.
- An API 403 indicates authorization failure after reaching the API endpoint.
- Context misselection can masquerade as a cluster outage.
Explanation
Correct Answer
A:Invalid static Pod manifests prevent kubelet from reconciling critical control-plane components. This principle explains the targeted result. A concrete response is: Validate static Pod YAML syntax and restore the last correct manifest version.
Incorrect Answers
B:This principle is useful for another case (A control-plane certificate replacement causes clients to reject the API server.), but does not explain the most direct solution here. Invalid static Pod manifests prevent kubelet from reconciling critical control-plane components.
C:This principle is useful for another case (An operator receives HTTP 403 Forbidden from the API server when listing Secrets.), but does not explain the most direct solution here.
D:Context misselection can masquerade as a cluster outage. This principle is useful for another case (kubectl suddenly reports connection refused after the team changed contexts.), but does not explain the most direct solution here. The governing consideration is: Invalid static Pod manifests prevent kubelet from reconciling critical control-plane components.
Question 303
A CKA learner must investigate the following: New claims omit storageClassName and use an unintended slow storage provider. Which command or check supplies the MOST direct diagnostic evidence?
- Describe the claim and compare capacity and access modes using kubectl get pv,pvc -o wide.
- Inspect StorageClasses for storageclass.kubernetes.io/is-default-class annotation.
- Inspect kubectl get volumeattachments and CSI controller/node Pod logs.
- Read the PVC accessModes and verify a second test Pod cannot mount the same claim simultaneously.
Explanation
Correct Answer
B:Inspect StorageClasses for storageclass.kubernetes.io/is-default-class annotation. This diagnostic examines the relevant resource or subsystem. Default StorageClasses influence requests that do not explicitly select a class. The validating result would be: New eligible PVCs select the intended default class.
Incorrect Answers
A:This check is appropriate to the separate problem (A PVC stays Pending because it asks for 20Gi while the only matching PV has 10Gi.), but it is not the direct diagnostic for the described failure.
C:This check is appropriate to the separate problem (A Pod is stuck ContainerCreating due to an attach timeout from a cloud block volume.), but it is not the direct diagnostic for the described failure. Inspect kubectl get volumeattachments and CSI controller/node Pod logs.
D:This check is appropriate to the separate problem (A database requires exclusive access by exactly one Pod to a PVC.), but it is not the direct diagnostic for the described failure. Read the PVC accessModes and verify a second test Pod cannot mount the same claim simultaneously.
Question 304
An administrator is investigating this situation: A worker requires OS maintenance while running replicated customer Pods. Which action BEST resolves the underlying issue?
- Use Kustomize bases and overlays rather than maintaining divergent full copies.
- Cordon and drain the node with appropriate eviction safeguards before maintenance.
- Inspect release history and roll back to the last healthy chart revision.
- Plan the ordered control-plane upgrade using kubeadm upgrade plan and supported version skew guidance.
Explanation
Correct Answer
B:Cordon and drain the node with appropriate eviction safeguards before maintenance. This correction targets the specific failure. Graceful node maintenance coordinates schedulability and safe workload eviction. A successful result is: Evictable workloads reschedule, disruption budgets are respected, and the node is safely maintained.
Incorrect Answers
A:Use Kustomize bases and overlays rather than maintaining divergent full copies. This procedure belongs to a different Kubernetes condition (Two clusters need the same base manifest but different replica counts and labels.). It does not directly resolve the observed failure. The targeted action is: Cordon and drain the node with appropriate eviction safeguards before maintenance.
C:Inspect release history and roll back to the last healthy chart revision. This procedure belongs to a different Kubernetes condition (A Helm upgrade caused a regression in a cluster add-on.). It does not directly resolve the observed failure. The targeted action is: Cordon and drain the node with appropriate eviction safeguards before maintenance.
D:Plan the ordered control-plane upgrade using kubeadm upgrade plan and supported version skew guidance.
Question 305
Consider the following Kubernetes administration case: A StatefulSet is decommissioned but its underlying audit volume must remain for investigation. Which principle BEST explains the intended solution?
- Retain preserves data resources for explicit lifecycle handling after claim deletion.
- PVC references from Pods are namespace-scoped.
- Delete reclaim policy instructs supported provisioners to remove backing assets.
- Default StorageClasses influence requests that do not explicitly select a class.
Explanation
Correct Answer
A:Retain preserves data resources for explicit lifecycle handling after claim deletion. This principle explains the targeted result. A concrete response is: Set reclaimPolicy Retain and manage retained PV and backend data under approved procedure.
Incorrect Answers
B:PVC references from Pods are namespace-scoped. This principle is useful for another case (A Pod reports FailedMount because its referenced PVC exists in a different namespace.), but does not explain the most direct solution here. The governing consideration is: Retain preserves data resources for explicit lifecycle handling after claim deletion.
C:This principle is useful for another case (A temporary dynamically provisioned data volume should be removed with its claim.), but does not explain the most direct solution here. Retain preserves data resources for explicit lifecycle handling after claim deletion.
D:This principle is useful for another case (New claims omit storageClassName and use an unintended slow storage provider.), but does not explain the most direct solution here. Retain preserves data resources for explicit lifecycle handling after claim deletion.
Question 306
A CKA learner must investigate the following: A newly deployed Service selector uses app=front while Pods are labeled app=frontend. Which command or check supplies the MOST direct diagnostic evidence?
- Check kubectl get pvc and kubectl describe pvc and Pod events.
- Inspect kubectl config view --minify and certificate notAfter dates.
- Compare kubectl get svc -o yaml selector to kubectl get pods --show-labels.
- Test nslookup and inspect egress policy ports 53 UDP/TCP for selected Pods.
Explanation
Correct Answer
C:Compare kubectl get svc -o yaml selector to kubectl get pods --show-labels. This diagnostic examines the relevant resource or subsystem. Service selectors must match label key/value pairs exactly. The validating result would be: EndpointSlices contain the expected ready frontend Pods and requests succeed.
Incorrect Answers
A:This check is appropriate to the separate problem (A Pod is Pending with a message about unbound immediate PersistentVolumeClaims.), but it is not the direct diagnostic for the described failure.
B:This check is appropriate to the separate problem (kubectl reports x509 certificate expired after months of successful access.), but it is not the direct diagnostic for the described failure.
D:This check is appropriate to the separate problem (Only Pods selected by a new egress policy fail DNS while other Pods resolve normally.), but it is not the direct diagnostic for the described failure. Compare kubectl get svc -o yaml selector to kubectl get pods --show-labels.
Question 307
A Kubernetes operator wants to verify this condition: Two API servers run but workloads use one control-plane node IP as the endpoint. Which investigation step is BEST suited to the case?
- Check load-balancer health and kubeconfig server addresses against the shared endpoint.
- Inspect the Role rules and test a named resource through kubectl auth can-i update configmap target -n ops --as=operator.
- Inspect Pod spec serviceAccountName and automountServiceAccountToken and exec to confirm unwanted token projection is absent.
- Run kubectl auth can-i create deployments -n finance --as=team-user and inspect all relevant bindings.
Explanation
Correct Answer
A:Check load-balancer health and kubeconfig server addresses against the shared endpoint. This diagnostic examines the relevant resource or subsystem. A highly available control plane needs a stable reachable API endpoint. The validating result would be: kubectl and joining nodes remain able to reach the API when one control-plane node fails.
Incorrect Answers
B:This check is appropriate to the separate problem (An operator must update one named ConfigMap but must not edit every ConfigMap.), but it is not the direct diagnostic for the described failure.
C:This check is appropriate to the separate problem (A Pod in test is unintentionally accessing the API with its default ServiceAccount.), but it is not the direct diagnostic for the described failure.
D:This check is appropriate to the separate problem (An admin changed RoleBindings and wants proof the operator cannot create deployments.), but it is not the direct diagnostic for the described failure. Check load-balancer health and kubeconfig server addresses against the shared endpoint.
Question 308
A review finds this Kubernetes issue: Database replicas require stable identities and persistent storage across rescheduling. Which suggestion would make troubleshooting or security worse?
- Record a rollback approach before high-impact control-plane changes.
- Use a stateless Deployment and rely on ephemeral emptyDir for durable database data.
- Confirm actual node conditions and allocatable resources before scheduling changes.
- Validate a change with a repeatable positive and negative test.
Explanation
Correct Answer
B:Use a stateless Deployment and rely on ephemeral emptyDir for durable database data. StatefulSets are suited to ordered, identity-aware stateful workloads. A safer course is: Use a StatefulSet with stable network identity and volumeClaimTemplates as appropriate.
Incorrect Answers
A:Record a rollback approach before high-impact control-plane changes. Deliberate rollback improves operational recoverability. For the stated case, a focused correction is: Use a StatefulSet with stable network identity and volumeClaimTemplates as appropriate.
C:Confirm actual node conditions and allocatable resources before scheduling changes. Scheduler behavior must be assessed against real node constraints. For the stated case, a focused correction is: Use a StatefulSet with stable network identity and volumeClaimTemplates as appropriate.
D:Validate a change with a repeatable positive and negative test. A testable outcome provides stronger evidence than intent alone. For the stated case, a focused correction is: Use a StatefulSet with stable network identity and volumeClaimTemplates as appropriate.
Question 309
A cluster team is handling this situation: Internal Service names resolve but Pods cannot resolve public domains through CoreDNS. Which proposed shortcut should be REJECTED?
- Record a rollback approach before high-impact control-plane changes.
- Delete the kubernetes DNS plugin because public names fail.
- Inspect the exact Secret or ConfigMap reference without exposing credentials.
- Verify the target cluster and namespace before mutating resources.
Explanation
Correct Answer
B:Delete the kubernetes DNS plugin because public names fail. CoreDNS typically forwards non-cluster queries to configured upstream resolvers. A safer course is: Inspect CoreDNS forward configuration, upstream resolver reachability and network policies.
Incorrect Answers
A:Record a rollback approach before high-impact control-plane changes. Deliberate rollback improves operational recoverability. For the stated case, a focused correction is: Inspect CoreDNS forward configuration, upstream resolver reachability and network policies.
C:Inspect the exact Secret or ConfigMap reference without exposing credentials. Configuration errors can be diagnosed without leaking sensitive data. For the stated case, a focused correction is: Inspect CoreDNS forward configuration, upstream resolver reachability and network policies.
D:Verify the target cluster and namespace before mutating resources. Explicit target context avoids changing the wrong environment. For the stated case, a focused correction is: Inspect CoreDNS forward configuration, upstream resolver reachability and network policies.
Question 310
A Kubernetes operations team observes the following: An operator wants temporary access to an internal Pod without publishing a public Service. What is the MOST appropriate corrective action?
- Use kubectl port-forward to an appropriate Pod or Service for authorized short-lived access.
- Configure the correct TLS Secret reference, namespace and host mapping in the Ingress.
- Correct HTTPRoute parentRefs, hostname and listener compatibility with the Gateway.
- Install or select a supported Gateway API controller and provision a valid GatewayClass and Gateway.
Explanation
Correct Answer
A:Use kubectl port-forward to an appropriate Pod or Service for authorized short-lived access. This correction targets the specific failure. Port forwarding is a debugging tunnel, not an internet-facing production endpoint. A successful result is: The operator can test the local forwarded port and no permanent external Service is created.
Incorrect Answers
B:This procedure belongs to a different Kubernetes condition (An HTTPS Ingress serves the wrong certificate for app.example.org.).
C:Correct HTTPRoute parentRefs, hostname and listener compatibility with the Gateway. This procedure belongs to a different Kubernetes condition (A Gateway exists but an HTTPRoute is not attached to its listener.). It does not directly resolve the observed failure. The targeted action is: Use kubectl port-forward to an appropriate Pod or Service for authorized short-lived access.
D:Install or select a supported Gateway API controller and provision a valid GatewayClass and Gateway.