CNCF CKA Practice Test 32
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.
Question 311
A cluster team is handling this situation: A Service virtual IP fails although direct Pod IP connectivity works. Which proposed shortcut should be REJECTED?
- Verify the target cluster and namespace before mutating resources.
- Confirm actual node conditions and allocatable resources before scheduling changes.
- Choose a storage access mode backed by real CSI capabilities.
- Reinstall the storage driver as the first fix for failed ClusterIP routing.
Explanation
Correct Answer
D:Reinstall the storage driver as the first fix for failed ClusterIP routing. Service VIP handling is distinct from basic Pod IP reachability. A safer course is: Inspect Service routing implementation, kube-proxy or equivalent dataplane, and endpoint health.
Incorrect Answers
A: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 Service routing implementation, kube-proxy or equivalent dataplane, and endpoint health.
B: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: Inspect Service routing implementation, kube-proxy or equivalent dataplane, and endpoint health.
C:Choose a storage access mode backed by real CSI capabilities. Requested volume semantics still depend on the storage implementation. For the stated case, a focused correction is: Inspect Service routing implementation, kube-proxy or equivalent dataplane, and endpoint health.
Question 312
To avoid guessing about this fault, what should be inspected first? A node reports high CPU use and latency spikes while the scheduler keeps assigning Pods.
- Run kubectl top nodes and kubectl top pods --containers --all-namespaces.
- Test nslookup and inspect egress policy ports 53 UDP/TCP for selected Pods.
- Use kubectl get events -n app --sort-by=.metadata.creationTimestamp with describe and timestamped logs.
- Inspect kubelet journal for manifest parsing errors and validate YAML locally.
Explanation
Correct Answer
A:Run kubectl top nodes and kubectl top pods --containers --all-namespaces. This diagnostic examines the relevant resource or subsystem. Resource pressure investigation requires measured utilization and scheduler reservation context. The validating result would be: The identified workload and node saturation explain latency and a targeted capacity change restores headroom.
Incorrect Answers
B: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. Run kubectl top nodes and kubectl top pods --containers --all-namespaces.
C:This check is appropriate to the separate problem (An incident responder sees Pod recreation, image pull and readiness failures and needs the order of events.), but it is not the direct diagnostic for the described failure. Run kubectl top nodes and kubectl top pods --containers --all-namespaces.
D:This check is appropriate to the separate problem (After a malformed YAML edit, kubelet stops running kube-controller-manager.), but it is not the direct diagnostic for the described failure. Run kubectl top nodes and kubectl top pods --containers --all-namespaces.
Question 313
An operations team tests its response to this finding: An HTTPS Ingress serves the wrong certificate for app.example.org. Which outcome most clearly establishes that the fix worked?
- Only the intended client Pods in team-a can reach the protected API.
- The route resolves the backend reference without opening unrelated namespace access.
- The operator can test the local forwarded port and no permanent external Service is created.
- TLS negotiation presents the expected certificate chain for the intended host.
Explanation
Correct Answer
D:TLS negotiation presents the expected certificate chain for the intended host. The corresponding action is: Configure the correct TLS Secret reference, namespace and host mapping in the Ingress.
Incorrect Answers
A:Only the intended client Pods in team-a can reach the protected API. This is evidence for a separate case (An API must accept ingress only from Pods labeled role=client in namespace team-a.), not for the target problem. An appropriate validation would be: TLS negotiation presents the expected certificate chain for the intended host.
B:The route resolves the backend reference without opening unrelated namespace access. This is evidence for a separate case (A Gateway API route in namespace web needs to refer to a backend Service in namespace shared.), not for the target problem. An appropriate validation would be: TLS negotiation presents the expected certificate chain for the intended host.
C:The operator can test the local forwarded port and no permanent external Service is created. This is evidence for a separate case (An operator wants temporary access to an internal Pod without publishing a public Service.), not for the target problem. An appropriate validation would be: TLS negotiation presents the expected certificate chain for the intended host.
Question 314
A Kubernetes operations team observes the following: Only Pods selected by a new egress policy fail DNS while other Pods resolve normally. What is the MOST appropriate corrective action?
- Check kubelet status, node heartbeats and API server reachability from that worker.
- Recover kubelet service after inspecting its systemd journal and configuration.
- Read the prior container instance logs using the --previous option.
- Allow required DNS egress to the cluster resolver while retaining intended isolation.
Explanation
Correct Answer
D:Allow required DNS egress to the cluster resolver while retaining intended isolation. This correction targets the specific failure. NetworkPolicy egress isolation can block DNS dependencies. A successful result is: Affected Pods resolve cluster and external names that policy permits.
Incorrect Answers
A:Check kubelet status, node heartbeats and API server reachability from that worker.
B:Recover kubelet service after inspecting its systemd journal and configuration. This procedure belongs to a different Kubernetes condition (All Pods on one node disappear from monitoring after kubelet service stops.). It does not directly resolve the observed failure. The targeted action is: Allow required DNS egress to the cluster resolver while retaining intended isolation.
C:Read the prior container instance logs using the --previous option. This procedure belongs to a different Kubernetes condition (An app container restarts so quickly that current kubectl logs show only its latest attempt.). It does not directly resolve the observed failure. The targeted action is: Allow required DNS egress to the cluster resolver while retaining intended isolation.
Question 315
A cluster issue is reported: A proposed upgrade would run kubelet newer than kube-apiserver. What practical check most directly confirms the suspected cause?
- Check kubectl drain worker-1 --ignore-daemonsets with appropriate flags and verify remaining endpoints.
- Run kubectl auth can-i create deployments -n finance --as=team-user and inspect all relevant bindings.
- Compare kubelet and API server versions against the official version-skew policy.
- Inspect crictl info and kubelet --container-runtime-endpoint configuration.
Explanation
Correct Answer
C:Compare kubelet and API server versions against the official version-skew policy. This diagnostic examines the relevant resource or subsystem. Kubelet must not be newer than its kube-apiserver under normal supported skew rules. The validating result would be: Control-plane and node versions remain within supported relationships after rollout.
Incorrect Answers
A:This check is appropriate to the separate problem (A worker requires OS maintenance while running replicated customer Pods.), but it is not the direct diagnostic for the described failure. Compare kubelet and API server versions against the official version-skew policy.
B: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. Compare kubelet and API server versions against the official version-skew policy.
D:This check is appropriate to the separate problem (A node image update changes the runtime socket and kubelet can no longer create containers.), but it is not the direct diagnostic for the described failure. Compare kubelet and API server versions against the official version-skew policy.
Question 316
During cluster maintenance, an engineer finds this problem: An application password is mistakenly embedded in a ConfigMap and exposed to broad readers. Which next action is technically justified?
- Mount a ConfigMap as a volume or use its keys in environment configuration as appropriate.
- Adjust realistic resource requests or add capacity before scheduling.
- Move the value into a Secret and restrict access with narrowly scoped RBAC.
- Roll back the Deployment to a known healthy revision using rollout undo.
Explanation
Correct Answer
C:Move the value into a Secret and restrict access with narrowly scoped RBAC. This correction targets the specific failure. Secrets support sensitive configuration but still require RBAC and encryption controls. A successful result is: The Pod reads the Secret using its configured reference while unauthorized users cannot retrieve it.
Incorrect Answers
A:This procedure belongs to a different Kubernetes condition (A workload requires a nonsecret configuration file that varies per namespace.). Mount a ConfigMap as a volume or use its keys in environment configuration as appropriate.
B:Adjust realistic resource requests or add capacity before scheduling. This procedure belongs to a different Kubernetes condition (A Pod is Pending because requested memory exceeds all node allocatable resources.). It does not directly resolve the observed failure. The targeted action is: Move the value into a Secret and restrict access with narrowly scoped RBAC.
D:Roll back the Deployment to a known healthy revision using rollout undo.
Question 317
A Kubernetes operator wants to verify this condition: A Pod reports FailedMount because its referenced PVC exists in a different namespace. Which investigation step is BEST suited to the case?
- Inspect PVC names and StatefulSet volumeClaimTemplates for each replica.
- Run kubectl describe pod -n application and kubectl get pvc -n application.
- Compare the Pod's volume source with PVC-backed volume configuration.
- Inspect kubectl get volumeattachments and CSI controller/node Pod logs.
Explanation
Correct Answer
B:Run kubectl describe pod -n application and kubectl get pvc -n application. This diagnostic examines the relevant resource or subsystem. PVC references from Pods are namespace-scoped. The validating result would be: The Pod's volume mounts successfully with its namespace-local claim.
Incorrect Answers
A:This check is appropriate to the separate problem (Two StatefulSet replicas accidentally share one manually named PVC and interfere with each other.), but it is not the direct diagnostic for the described failure.
C:This check is appropriate to the separate problem (A team stores a critical database file in an emptyDir volume and loses it after Pod replacement.), but it is not the direct diagnostic for the described failure.
D: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. Run kubectl describe pod -n application and kubectl get pvc -n application.
Question 318
A platform engineer receives this incident: Pods reach cluster Services but cannot contact external APIs from private node networks. Which change should be made first after validating the facts?
- Check lease access, API connectivity and component identity for leader election.
- Recover kubelet service after inspecting its systemd journal and configuration.
- Inspect current context and configured cluster server address, then choose the correct target.
- Check egress route and SNAT or gateway configuration for the cluster network.
Explanation
Correct Answer
D:Check egress route and SNAT or gateway configuration for the cluster network. This correction targets the specific failure. External egress requires network routing beyond internal Service discovery. A successful result is: Allowed Pods reach external endpoints with expected source IP routing.
Incorrect Answers
A:This procedure belongs to a different Kubernetes condition (Multiple scheduler Pods run but none can acquire the leader lease.). Check lease access, API connectivity and component identity for leader election.
B:Recover kubelet service after inspecting its systemd journal and configuration. This procedure belongs to a different Kubernetes condition (All Pods on one node disappear from monitoring after kubelet service stops.). It does not directly resolve the observed failure. The targeted action is: Check egress route and SNAT or gateway configuration for the cluster network.
C:This procedure belongs to a different Kubernetes condition (kubectl suddenly reports connection refused after the team changed contexts.). Inspect current context and configured cluster server address, then choose the correct target.
Question 319
During remediation, this failure appears: Replicas concentrate in one availability zone and violate resilience goals. Which action is the LEAST defensible?
- Validate a change with a repeatable positive and negative test.
- Confirm actual node conditions and allocatable resources before scheduling changes.
- Use maxSkew zero and ignore scheduler validation rules.
- Review controller logs and resource status to understand reconciliation failures.
Explanation
Correct Answer
C:Use maxSkew zero and ignore scheduler validation rules. Topology spread balances placement across labeled failure domains. A safer course is: Configure topologySpreadConstraints with topologyKey and appropriate maxSkew behavior.
Incorrect Answers
A: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: Configure topologySpreadConstraints with topologyKey and appropriate maxSkew behavior.
B: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: Configure topologySpreadConstraints with topologyKey and appropriate maxSkew behavior.
D:Review controller logs and resource status to understand reconciliation failures. Controller evidence can distinguish desired state from observed failure. For the stated case, a focused correction is: Configure topologySpreadConstraints with topologyKey and appropriate maxSkew behavior.
Question 320
An engineer needs to justify a change for this issue: Pods on one worker fail while the node reports DiskPressure. Which technical reason is MOST relevant?
- Context misselection can masquerade as a cluster outage.
- Image and ephemeral filesystem consumption can trigger node disk pressure and evictions.
- Autoscaling requires available metrics and valid target configuration.
- Service routing depends on node dataplane health distinct from Pod connectivity.
Explanation
Correct Answer
B:Image and ephemeral filesystem consumption can trigger node disk pressure and evictions. This principle explains the targeted result. A concrete response is: Inspect image, container log and ephemeral-storage usage and reclaim space safely.
Incorrect Answers
A: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: Image and ephemeral filesystem consumption can trigger node disk pressure and evictions.
C:Autoscaling requires available metrics and valid target configuration. This principle is useful for another case (HPA displays <unknown> target metrics while replicas never scale.), but does not explain the most direct solution here. The governing consideration is: Image and ephemeral filesystem consumption can trigger node disk pressure and evictions.
D:This principle is useful for another case (Service ClusterIP connections fail on one node even though direct Pod IP connections work.), but does not explain the most direct solution here. Image and ephemeral filesystem consumption can trigger node disk pressure and evictions.