CNCF CKA Practice Test 70
Question 690
A cluster administrator must address the following case: A controller ServiceAccount needs to read ConfigMaps only in team-a. Select TWO appropriate statements, one corrective action and one observable outcome.
- Validation: The new node trusts and joins the expected API server without accepting an arbitrary endpoint.
- Remediation: Bind the cluster-admin ClusterRole to the controller for convenience.
- Validation: The controller can get its intended ConfigMaps but cannot modify Secrets or read other namespaces.
- Remediation: Create a namespaced Role and RoleBinding in prod granting only required pod verbs to the user or group.
- Remediation: Bind a narrowly scoped Role to the controller ServiceAccount in team-a.
Explanation
Correct Answers
C:Validation: The controller can get its intended ConfigMaps but cannot modify Secrets or read other namespaces. This result verifies the behavior the remediation is supposed to restore.
E:Remediation: Bind a narrowly scoped Role to the controller ServiceAccount in team-a. The remedy targets the reported failure rather than a different subsystem. ServiceAccount identity does not automatically confer application-specific API permissions.
Incorrect Answers
A:Validation: The new node trusts and joins the expected API server without accepting an arbitrary endpoint. This evidence applies to a different condition (A worker join fails with a discovery CA certificate hash mismatch.), and would not verify this target fix: A controller ServiceAccount needs to read ConfigMaps only in team-a.
B:Remediation: Bind the cluster-admin ClusterRole to the controller for convenience. This is the unsafe shortcut for the case, not an acceptable intervention. ServiceAccount identity does not automatically confer application-specific API permissions.
D:This action targets a different condition (A namespace user can list Pods in dev but receives Forbidden in prod.), not this reported failure: A controller ServiceAccount needs to read ConfigMaps only in team-a.
Question 691
During cluster maintenance, an engineer finds this problem: An app writes errors to stderr but a team searches only a file in the container image. Which next action is technically justified?
- Correct targetPort or named container port mapping to the actual listener.
- Allow required DNS egress to the cluster resolver while retaining intended isolation.
- Inspect aggregated container stdout/stderr using kubectl logs or the configured logging pipeline.
- Review CoreDNS logs and Corefile configuration, then restore a valid DNS Deployment.
Explanation
Correct Answer
C:Inspect aggregated container stdout/stderr using kubectl logs or the configured logging pipeline. This correction targets the specific failure. Kubernetes container log viewing relies on container output streams, not arbitrary files. A successful result is: Expected error lines appear in container output with time and container identity.
Incorrect Answers
A:Correct targetPort or named container port mapping to the actual listener. This procedure belongs to a different Kubernetes condition (A Service has healthy endpoints but its targetPort points to 9090 while Pods listen on 8080.). It does not directly resolve the observed failure. The targeted action is: Inspect aggregated container stdout/stderr using kubectl logs or the configured logging pipeline.
B:Allow required DNS egress to the cluster resolver while retaining intended isolation. This procedure belongs to a different Kubernetes condition (Only Pods selected by a new egress policy fail DNS while other Pods resolve normally.). It does not directly resolve the observed failure. The targeted action is: Inspect aggregated container stdout/stderr using kubectl logs or the configured logging pipeline.
D:Review CoreDNS logs and Corefile configuration, then restore a valid DNS Deployment. This procedure belongs to a different Kubernetes condition (Pods cannot resolve cluster Service names and CoreDNS Pods are CrashLoopBackOff.). It does not directly resolve the observed failure. The targeted action is: Inspect aggregated container stdout/stderr using kubectl logs or the configured logging pipeline.
Question 692
A CKA learner must investigate the following: A team thinks applying an ingress-only policy prevents Pods from sending outbound traffic. Which command or check supplies the MOST direct diagnostic evidence?
- Compare direct Pod and ClusterIP curl tests and inspect kube-proxy logs where applicable.
- Run nslookup from an isolated Pod and check egress rules for resolver traffic.
- Inspect Service spec.sessionAffinity and test requests from controlled source IPs.
- Inspect spec.policyTypes and run an outbound connectivity test from the selected Pod.
Explanation
Correct Answer
D:Inspect spec.policyTypes and run an outbound connectivity test from the selected Pod. This diagnostic examines the relevant resource or subsystem. Ingress and egress isolation are independent in NetworkPolicy. The validating result would be: Disallowed outbound connections fail while approved egress stays functional.
Incorrect Answers
A:This check is appropriate to the separate problem (A Service virtual IP fails although direct Pod IP connectivity works.), but it is not the direct diagnostic for the described failure. Inspect spec.policyTypes and run an outbound connectivity test from the selected Pod.
B:This check is appropriate to the separate problem (Egress-isolated Pods cannot resolve DNS even though their app traffic policy is correct.), but it is not the direct diagnostic for the described failure.
C:This check is appropriate to the separate problem (A legacy client needs repeated requests to tend to the same Pod behind one Service.), but it is not the direct diagnostic for the described failure. Inspect spec.policyTypes and run an outbound connectivity test from the selected Pod.
Question 693
A platform engineer receives this incident: A container is running but cannot serve requests until a cache is primed. Which change should be made first after validating the facts?
- Roll back the Deployment to a known healthy revision using rollout undo.
- Label eligible hardware nodes and use an explicit nodeSelector or required node affinity.
- Configure topologySpreadConstraints with topologyKey and appropriate maxSkew behavior.
- Configure a readinessProbe that tests the actual application readiness endpoint.
Explanation
Correct Answer
D:Configure a readinessProbe that tests the actual application readiness endpoint. This correction targets the specific failure. Readiness probes gate traffic eligibility, not whether the container process exists. A successful result is: The Pod is excluded from Service endpoints until it becomes ready.
Incorrect Answers
A:Roll back the Deployment to a known healthy revision using rollout undo. This procedure belongs to a different Kubernetes condition (A recent Deployment image change causes requests to fail and the previous revision worked.). It does not directly resolve the observed failure. The targeted action is: Configure a readinessProbe that tests the actual application readiness endpoint.
B:Label eligible hardware nodes and use an explicit nodeSelector or required node affinity. This procedure belongs to a different Kubernetes condition (A GPU workload was scheduled on a node without GPU hardware.). It does not directly resolve the observed failure. The targeted action is: Configure a readinessProbe that tests the actual application readiness endpoint.
C:Configure topologySpreadConstraints with topologyKey and appropriate maxSkew behavior. This procedure belongs to a different Kubernetes condition (Replicas concentrate in one availability zone and violate resilience goals.). It does not directly resolve the observed failure. The targeted action is: Configure a readinessProbe that tests the actual application readiness endpoint.
Question 694
An administrator reviews several possible responses to this condition: A workload requires a nonsecret configuration file that varies per namespace. Which option creates an avoidable failure?
- Inspect the exact Secret or ConfigMap reference without exposing credentials.
- Record a rollback approach before high-impact control-plane changes.
- Hard-code environment-specific values in a shared image and redeploy every cluster.
- Keep backups or change history for potentially destructive maintenance.
Explanation
Correct Answer
C:Hard-code environment-specific values in a shared image and redeploy every cluster. ConfigMaps separate ordinary configuration from container images. A safer course is: Mount a ConfigMap as a volume or use its keys in environment configuration as appropriate.
Incorrect Answers
A: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: Mount a ConfigMap as a volume or use its keys in environment configuration as appropriate.
B:Record a rollback approach before high-impact control-plane changes. Deliberate rollback improves operational recoverability. For the stated case, a focused correction is: Mount a ConfigMap as a volume or use its keys in environment configuration as appropriate.
D:Keep backups or change history for potentially destructive maintenance. Recovery planning reduces the impact of a faulty change. For the stated case, a focused correction is: Mount a ConfigMap as a volume or use its keys in environment configuration as appropriate.
Question 695
In a Kubernetes cluster, the following condition is observed: All Pods lose service-name resolution after the CoreDNS Deployment becomes unavailable. Which remediation MOST directly addresses it?
- Inspect CoreDNS forward configuration, upstream resolver reachability and network policies.
- Restore healthy CoreDNS replicas and verify their upstream and service plugin configuration.
- Use kubectl port-forward to an appropriate Pod or Service for authorized short-lived access.
- Correct Ingress paths and pathType mapping to the proper Service backends.
Explanation
Correct Answer
B:Restore healthy CoreDNS replicas and verify their upstream and service plugin configuration. This correction targets the specific failure. Kubernetes Service DNS depends on a functioning DNS service and its configuration. A successful result is: In-cluster Service names resolve again from test Pods.
Incorrect Answers
A:Inspect CoreDNS forward configuration, upstream resolver reachability and network policies. This procedure belongs to a different Kubernetes condition (Internal Service names resolve but Pods cannot resolve public domains through CoreDNS.). It does not directly resolve the observed failure. The targeted action is: Restore healthy CoreDNS replicas and verify their upstream and service plugin configuration.
C:Use kubectl port-forward to an appropriate Pod or Service for authorized short-lived access. This procedure belongs to a different Kubernetes condition (An operator wants temporary access to an internal Pod without publishing a public Service.). It does not directly resolve the observed failure. The targeted action is: Restore healthy CoreDNS replicas and verify their upstream and service plugin configuration.
D:Correct Ingress paths and pathType mapping to the proper Service backends. This procedure belongs to a different Kubernetes condition (Traffic to /api is routed to the frontend Service rather than the API backend.). It does not directly resolve the observed failure. The targeted action is: Restore healthy CoreDNS replicas and verify their upstream and service plugin configuration.
Question 696
A cluster issue is reported: A control-plane certificate replacement causes clients to reject the API server. What practical check most directly confirms the suspected cause?
- Inspect Pod requiredDuringScheduling node affinity and node labels.
- Inspect the apiserver serving cert with openssl x509 and compare endpoint hostnames.
- Inspect kubectl get apiservice v1beta1.metrics.k8s.io and metrics-server Pod logs.
- Inspect policy selectors and test TCP connectivity from approved and denied Pods.
Explanation
Correct Answer
B:Inspect the apiserver serving cert with openssl x509 and compare endpoint hostnames. This diagnostic examines the relevant resource or subsystem. TLS validation requires matching server identity and trusted certificate chain. The validating result would be: Clients verify and connect to the legitimate API server after certificate correction.
Incorrect Answers
A:This check is appropriate to the separate problem (A Pod requests a non-existent node label through required node affinity.), but it is not the direct diagnostic for the described failure. Inspect the apiserver serving cert with openssl x509 and compare endpoint hostnames.
C:This check is appropriate to the separate problem (kubectl top nodes fails with Metrics API not available.), but it is not the direct diagnostic for the described failure.
D:This check is appropriate to the separate problem (After a default-deny NetworkPolicy, a required API-to-database connection times out.), but it is not the direct diagnostic for the described failure. Inspect the apiserver serving cert with openssl x509 and compare endpoint hostnames.
Question 697
A platform engineer receives this incident: An application fails because its database initialization must happen before the main process. Which change should be made first after validating the facts?
- Ensure relevant CPU requests are defined and the resource metrics pipeline is working.
- Add a startupProbe with a startup budget before liveness checking begins.
- Configure a readinessProbe that tests the actual application readiness endpoint.
- Use an initContainer for prerequisite checks or initialization steps.
Explanation
Correct Answer
D:Use an initContainer for prerequisite checks or initialization steps. This correction targets the specific failure. Init containers sequence prerequisite work before ordinary containers. A successful result is: Main application containers start only after initContainers complete successfully.
Incorrect Answers
A:Ensure relevant CPU requests are defined and the resource metrics pipeline is working. This procedure belongs to a different Kubernetes condition (HPA reports unknown CPU utilization although Pods are running.). It does not directly resolve the observed failure. The targeted action is: Use an initContainer for prerequisite checks or initialization steps.
B:Add a startupProbe with a startup budget before liveness checking begins. This procedure belongs to a different Kubernetes condition (A Java application needs two minutes to initialize but liveness checks restart it at 30 seconds.). It does not directly resolve the observed failure. The targeted action is: Use an initContainer for prerequisite checks or initialization steps.
C:Configure a readinessProbe that tests the actual application readiness endpoint. This procedure belongs to a different Kubernetes condition (A container is running but cannot serve requests until a cache is primed.). It does not directly resolve the observed failure. The targeted action is: Use an initContainer for prerequisite checks or initialization steps.
Question 698
A cluster team is handling this situation: All Pods lose service-name resolution after the CoreDNS Deployment becomes unavailable. Which proposed shortcut should be REJECTED?
- Inspect Pod and component events before changing unrelated resources.
- Replace every Service with a fixed host IP and ignore DNS health.
- Choose a storage access mode backed by real CSI capabilities.
- Use a staged rollout and observe readiness before full deployment.
Explanation
Correct Answer
B:Replace every Service with a fixed host IP and ignore DNS health. Kubernetes Service DNS depends on a functioning DNS service and its configuration. A safer course is: Restore healthy CoreDNS replicas and verify their upstream and service plugin configuration.
Incorrect Answers
A:Inspect Pod and component events before changing unrelated resources. Observed events help locate the failing subsystem before a change. For the stated case, a focused correction is: Restore healthy CoreDNS replicas and verify their upstream and service plugin configuration.
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: Restore healthy CoreDNS replicas and verify their upstream and service plugin configuration.
D:Use a staged rollout and observe readiness before full deployment. Staged changes reduce simultaneous loss of healthy replicas. For the stated case, a focused correction is: Restore healthy CoreDNS replicas and verify their upstream and service plugin configuration.
Question 699
An administrator reviews several possible responses to this condition: A kubectl command is applying objects in the wrong environment after a context switch. Which option creates an avoidable failure?
- Preserve relevant logs when diagnosing a repeating container crash.
- Verify the target cluster and namespace before mutating resources.
- Inspect the exact Secret or ConfigMap reference without exposing credentials.
- Run kubectl delete on whichever context happens to be active.
Explanation
Correct Answer
D:Run kubectl delete on whichever context happens to be active. This shortcut fails to address the root cause and risks a worse outcome. kubectl uses current-context, user and cluster mappings that must be validated. A safer course is: Inspect available kubeconfig contexts and explicitly select or specify the intended context.
Incorrect Answers
A:Preserve relevant logs when diagnosing a repeating container crash. This is an appropriate safeguard, not the unsafe shortcut. Prior process output often identifies the immediate cause. For the stated case, a focused correction is: Inspect available kubeconfig contexts and explicitly select or specify the intended context.
B: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 available kubeconfig contexts and explicitly select or specify the intended context.
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 available kubeconfig contexts and explicitly select or specify the intended context.
Question 700
A cluster issue is reported: An app writes errors to stderr but a team searches only a file in the container image. What practical check most directly confirms the suspected cause?
- Compare kubectl get svc -o yaml selector to kubectl get pods --show-labels.
- Inspect kubelet journal for manifest parsing errors and validate YAML locally.
- Use kubectl logs -n app deployment/web --all-containers=true --timestamps.
- Inspect kubectl describe pod and initContainerStatuses for pull errors.
Explanation
Correct Answer
C:Use kubectl logs -n app deployment/web --all-containers=true --timestamps. This diagnostic examines the relevant resource or subsystem. Kubernetes container log viewing relies on container output streams, not arbitrary files. The validating result would be: Expected error lines appear in container output with time and container identity.
Incorrect Answers
A:This check is appropriate to the separate problem (A newly deployed Service selector uses app=front while Pods are labeled app=frontend.), but it is not the direct diagnostic for the described failure. Compare kubectl get svc -o yaml selector to kubectl get pods --show-labels.
B:Inspect kubelet journal for manifest parsing errors and validate YAML locally. 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. The relevant check is: Use kubectl logs -n app deployment/web --all-containers=true --timestamps.
D:Inspect kubectl describe pod and initContainerStatuses for pull errors. This check is appropriate to the separate problem (The main app never starts because an initContainer image is inaccessible.), but it is not the direct diagnostic for the described failure. The relevant check is: Use kubectl logs -n app deployment/web --all-containers=true --timestamps.