Practice Exams:

Linux Foundation KCNA Dumps

EXAM: Kubernetes and Cloud Native Associate
Verified By Experts
Premium Bundle
$40.00
$59.97 $99.97

KCNA Premium Bundle


  • Premium File 333 Questions & Answers
  • Training Course 54 Lectures
  • Study Guide 410 Pages

Linux Foundation KCNA Practice Test 42

Question 410

A city records service keeps durable PDF attachments on an emptyDir and loses them during maintenance. Which implementation together with matching acceptance evidence best meets this case?

  1. Taint dedicated nodes and grant only intended workloads matching tolerations, combining node affinity when exclusive placement is required. Acceptance evidence: Taint a lab worker dedicated=training:NoSchedule, then compare placement of Pods with and without the toleration.
  2. Use emptyDir for temporary sharing between containers within a Pod, and PVC-backed storage when data must survive Pod replacement. Acceptance evidence: Write a synthetic temporary file into emptyDir, restart a container and then recreate the Pod to compare lifetime semantics.
  3. Define post-release checks for readiness, error rate and latency, and revert an unhealthy revision using an approved rollout mechanism. Acceptance evidence: Deploy a synthetic faulty image, monitor request errors and confirm the release controller or operator restores the last known healthy revision.
  4. Use narrowly scoped imagePullSecrets or an approved node identity to authorize the runtime to pull a private image. Acceptance evidence: Deploy a synthetic private image using an approved Secret and confirm unauthorized namespaces cannot reuse a broad registry token.

Explanation

Correct Answer

B:

The situation is that a city records service keeps durable PDF attachments on an emptyDir and loses them during maintenance. Use emptyDir for temporary sharing between containers within a Pod, and PVC-backed storage when data must survive Pod replacement. Acceptance evidence: Write a synthetic temporary file into emptyDir, restart a container and then recreate the Pod to compare lifetime semantics. This pairing is justified because emptyDir is initialized for a Pod and its contents can be shared among containers but do not survive the Pod's removal.

Incorrect Answers

A:

This action and check address the distinct objective “Understand taints and tolerations as repulsion controls” instead of the stated acceptance requirement. The matching action is to use emptyDir for temporary sharing between containers within a Pod, and PVC-backed storage when data must survive Pod replacement. Its confirming test is to write a synthetic temporary file into emptyDir, restart a container and then recreate the Pod to compare lifetime semantics.

C:

This action and check address the distinct objective “Design a release rollback trigger from measurable service signals” instead of the stated acceptance requirement. The matching action is to use emptyDir for temporary sharing between containers within a Pod, and PVC-backed storage when data must survive Pod replacement. Its confirming test is to write a synthetic temporary file into emptyDir, restart a container and then recreate the Pod to compare lifetime semantics.

D:

This action and check address the distinct objective “Handle private registry pulls with dedicated credentials instead of embedding secrets in images” instead of the stated acceptance requirement. The matching action is to use emptyDir for temporary sharing between containers within a Pod, and PVC-backed storage when data must survive Pod replacement. Its confirming test is to write a synthetic temporary file into emptyDir, restart a container and then recreate the Pod to compare lifetime semantics.

Question 411

A hospital deploys an HTTP API that only needs to bind an unprivileged port. Which supported Kubernetes practice directly addresses the stated requirement?

  1. Combine a default-deny baseline with narrow app-label and namespace-label NetworkPolicy rules for approved traffic.
  2. Separate compile and runtime stages to retain only required binary and runtime dependencies in the deployed container image.
  3. Use narrowly scoped imagePullSecrets or an approved node identity to authorize the runtime to pull a private image.
  4. Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root.

Explanation

Correct Answer

D:

Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. This resolves the issue because securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised. To verify, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

Incorrect Answers

A:

This option addresses the distinct objective “Limit workload-to-workload access with explicit NetworkPolicy allow rules”, not the immediate requirement. NetworkPolicies select Pods and define allowed flows; when a Pod becomes isolated, traffic is allowed only as permitted by applicable rules and plugin behavior. For the stated case, securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

B:

This option addresses the distinct objective “Build smaller images with multistage builds and remove unnecessary tooling”, not the immediate requirement. Multistage builds reduce image contents and potential attack surface by keeping build toolchains and source artifacts out of the final runtime layer. For the stated case, securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

C:

This option addresses the distinct objective “Handle private registry pulls with dedicated credentials instead of embedding secrets in images”, not the immediate requirement. Image-pull credentials are consumed before the application starts and should not be hardcoded into container layers or app logs. For the stated case, securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Question 412

A hospital deploys an HTTP API that only needs to bind an unprivileged port. Which causal explanation supports the intended design choice?

  1. Image-pull credentials are consumed before the application starts and should not be hardcoded into container layers or app logs.
  2. A NotReady or pressure-affected node can stop hosting healthy Pods even when their Deployment and Service definitions remain valid.
  3. SecurityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.
  4. An image contains layers and configuration; each container adds runtime state that can vanish on replacement unless data uses explicit persistent storage.

Explanation

Correct Answer

C:

SecurityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised. It supports this action: Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. To confirm, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

Incorrect Answers

A:

That statement explains the distinct objective “Handle private registry pulls with dedicated credentials instead of embedding secrets in images” rather than the cause in this case. The deciding mechanism here is that securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

B:

That statement explains the distinct objective “Use node conditions and allocatable capacity to diagnose NotReady workloads” rather than the cause in this case. The deciding mechanism here is that securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

D:

That statement explains the distinct objective “Distinguish a container image from a running container and its writable layer” rather than the cause in this case. The deciding mechanism here is that securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Question 413

A hospital deploys an HTTP API that only needs to bind an unprivileged port. Which test provides the strongest evidence of a correct implementation?

  1. With restricted identities, check get pods succeeds while delete secrets and create clusterroles are denied.
  2. Write a synthetic temporary file into emptyDir, restart a container and then recreate the Pod to compare lifetime semantics.
  3. Deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.
  4. Test a staged Service with a mismatched selector and separately a healthy endpoint with the wrong targetPort to compare symptoms.

Explanation

Correct Answer

C:

Deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work. This is the relevant test because securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Incorrect Answers

A:

This check would help evaluate the distinct objective “Use least-privilege kubectl authentication and authorization during routine administration”, but not the required result. For this case, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

B:

This check would help evaluate the distinct objective “Understand emptyDir as Pod-lifetime shared storage, not durable application persistence”, but not the required result. For this case, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

D:

This check would help evaluate the distinct objective “Distinguish a failed Service selector from broken DNS or a failing backend”, but not the required result. For this case, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

Question 414

A hospital deploys an HTTP API that only needs to bind an unprivileged port. A shortcut is proposed: “Set privileged=true on every Pod so normal application file-permission errors disappear.” Which technical consequence follows most closely?

  1. More replicas fail the same way because the process configuration, not desired replica count, caused the exit.
  2. Containers gain broad host exposure and compromise blast radius becomes larger than the application's needs.
  3. Credentials can leak through registries and the binaries cannot be compared as the same tested artifact.
  4. A resource can remain Pending indefinitely even while its desired configuration is stored correctly.

Explanation

Correct Answer

B:

Containers gain broad host exposure and compromise blast radius becomes larger than the application's needs. The shortcut creates this risk because securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Incorrect Answers

A:

That outcome concerns the distinct objective “Understand ENTRYPOINT and command overrides when a container exits immediately”; it is not the most direct consequence of this shortcut. The relevant consequence is that containers gain broad host exposure and compromise blast radius becomes larger than the application's needs.

C:

That outcome concerns the distinct objective “Externalize application configuration from an image while protecting secrets”; it is not the most direct consequence of this shortcut. The relevant consequence is that containers gain broad host exposure and compromise blast radius becomes larger than the application's needs.

D:

That outcome concerns the distinct objective “Interpret Kubernetes spec and status fields without confusing intent with condition”; it is not the most direct consequence of this shortcut. The relevant consequence is that containers gain broad host exposure and compromise blast radius becomes larger than the application's needs.

Question 415

A hospital deploys an HTTP API that only needs to bind an unprivileged port. Which combined solution and independent check are most directly justified?

  1. Build an OCI-compatible image with immutable packaged artifacts and treat running container writable state as ephemeral. Acceptance evidence: Build a test image, run a Pod and recreate it, verifying packaged files remain while an unmounted temporary file disappears.
  2. Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Acceptance evidence: Deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.
  3. Put non-sensitive application settings in ConfigMaps and put credentials in Secret objects with RBAC, encryption and external secret-management safeguards where appropriate. Acceptance evidence: Inspect synthetic ConfigMap and Secret manifests, then test that an unprivileged ServiceAccount cannot read the private Secret.
  4. Give clients a Service DNS name rather than hardcoding Pod IP addresses that can change when replicas are replaced. Acceptance evidence: Delete and replace a Deployment Pod and verify a client continues to reach its Service DNS name despite changed backend Pod addresses.

Explanation

Correct Answer

B:

Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Acceptance evidence: Deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work. This pairing is justified because securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Incorrect Answers

A:

This action and check address the distinct objective “Distinguish a container image from a running container and its writable layer” instead of the stated acceptance requirement. The matching action is to set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Its confirming test is to deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

C:

This action and check address the distinct objective “Distinguish ConfigMaps from Secrets and avoid storing credentials in public configuration” instead of the stated acceptance requirement. The matching action is to set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Its confirming test is to deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

D:

This action and check address the distinct objective “Distinguish Pod IPs from stable Services during rescheduling” instead of the stated acceptance requirement. The matching action is to set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Its confirming test is to deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

Question 416

A nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. Which supported Kubernetes practice directly addresses the stated requirement?

  1. Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root.
  2. Identify whether the cluster uses kube-proxy or an alternative Service dataplane before diagnosing virtual Service IP forwarding behavior.
  3. Run controlled DNS queries and IP connectivity tests before changing service discovery, CNI routes or application endpoints.
  4. Build an OCI-compatible image with immutable packaged artifacts and treat running container writable state as ephemeral.

Explanation

Correct Answer

A:

The situation is that a nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. This resolves the issue because securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised. To verify, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

Incorrect Answers

B:

This option addresses the distinct objective “Understand service proxy implementations without assuming kube-proxy is mandatory”, not the immediate requirement. Kube-proxy can maintain node networking rules for Services, but supported network implementations may replace this function. For the stated case, securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

C:

This option addresses the distinct objective “Diagnose cluster DNS separately from Pod network reachability”, not the immediate requirement. Healthy direct IP connectivity with failed name resolution suggests a DNS path issue; failed Pod-to-Pod IP traffic suggests a lower-level network problem. For the stated case, securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

D:

This option addresses the distinct objective “Distinguish a container image from a running container and its writable layer”, not the immediate requirement. An image contains layers and configuration; each container adds runtime state that can vanish on replacement unless data uses explicit persistent storage. For the stated case, securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Question 417

A nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. Which causal explanation supports the intended design choice?

  1. SecurityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.
  2. A DaemonSet controller targets eligible nodes for a Pod each, adapting to node additions and labels rather than maintaining a global arbitrary replica count.
  3. Linux namespaces affect visibility and isolation boundaries, while cgroups organize and limit resource usage; neither automatically supplies a full virtual machine.
  4. CoreDNS watches Service objects and serves cluster-aware names; bare names normally resolve relative to the requesting Pod's namespace and search domains.

Explanation

Correct Answer

A:

The situation is that a nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. SecurityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised. It supports this action: Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. To confirm, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

Incorrect Answers

B:

That statement explains the distinct objective “Select DaemonSet for node-local agents rather than Deployment replica counts” rather than the cause in this case. The deciding mechanism here is that securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

C:

That statement explains the distinct objective “Explain Linux namespaces and cgroups as distinct container isolation mechanisms” rather than the cause in this case. The deciding mechanism here is that securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

D:

That statement explains the distinct objective “Verify CoreDNS resolution and namespace-qualified Service names” rather than the cause in this case. The deciding mechanism here is that securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Question 418

A nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. Which test provides the strongest evidence of a correct implementation?

  1. Use a synthetic two-node workload and compare expected attach behavior for an RWO volume with a documented RWX shared filesystem.
  2. Compare kubectl get pods -o wide with kubectl describe pod for a test image-pull failure and note which output shows recent Events.
  3. Deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.
  4. Deploy a synthetic private image using an approved Secret and confirm unauthorized namespaces cannot reuse a broad registry token.

Explanation

Correct Answer

C:

The situation is that a nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. Deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work. This is the relevant test because securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Incorrect Answers

A:

This check would help evaluate the distinct objective “Choose ReadWriteOnce and ReadWriteMany access modes by backend capability”, but not the required result. For this case, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

B:

This check would help evaluate the distinct objective “Use kubectl get and describe for distinct inspection needs”, but not the required result. For this case, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

D:

This check would help evaluate the distinct objective “Handle private registry pulls with dedicated credentials instead of embedding secrets in images”, but not the required result. For this case, deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

Question 419

A nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. A shortcut is proposed: “Set privileged=true on every Pod so normal application file-permission errors disappear.” Which technical consequence follows most closely?

  1. The deployed artifact grows, may leak build credentials and exposes unnecessary packages.
  2. The scheduler could place multiple replicas together, leaving a node without the intended local collector.
  3. Containers gain broad host exposure and compromise blast radius becomes larger than the application's needs.
  4. Monitoring dashboards show empty or stale series because the expected metrics were never exposed or scraped.

Explanation

Correct Answer

C:

The situation is that a nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. Containers gain broad host exposure and compromise blast radius becomes larger than the application's needs. The shortcut creates this risk because securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Incorrect Answers

A:

That outcome concerns the distinct objective “Build smaller images with multistage builds and remove unnecessary tooling”; it is not the most direct consequence of this shortcut. The relevant consequence is that containers gain broad host exposure and compromise blast radius becomes larger than the application's needs.

B:

That outcome concerns the distinct objective “Select DaemonSet for node-local agents rather than Deployment replica counts”; it is not the most direct consequence of this shortcut. The relevant consequence is that containers gain broad host exposure and compromise blast radius becomes larger than the application's needs.

D:

That outcome concerns the distinct objective “Understand Prometheus pull-based metrics collection and exporters”; it is not the most direct consequence of this shortcut. The relevant consequence is that containers gain broad host exposure and compromise blast radius becomes larger than the application's needs.

Question 420

A nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. Which combined solution and independent check are most directly justified?

  1. Separate compile and runtime stages to retain only required binary and runtime dependencies in the deployed container image. Acceptance evidence: Compare SBOM and file inventory of the builder image with the published runtime stage and confirm the service still starts.
  2. Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Acceptance evidence: Deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.
  3. Define appropriate HTTP routing through an installed Ingress controller or Gateway API controller rather than expecting the API object alone to provision a proxy. Acceptance evidence: Deploy a test hostname route, verify a compatible controller exists and inspect the programmed listener and backend status.
  4. Apply appropriate ResourceQuota and LimitRange policy to bound namespace consumption and guide default container resource requests or limits. Acceptance evidence: Create a controlled test namespace with a tiny quota and verify a request exceeding aggregate limits is rejected.

Explanation

Correct Answer

B:

The situation is that a nonprofit investigates a container requiring root solely because its image directory permissions were configured incorrectly. Set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Acceptance evidence: Deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work. This pairing is justified because securityContext configures process identity and privilege boundaries, and unnecessary root privileges increase impact if an application is compromised.

Incorrect Answers

A:

This action and check address the distinct objective “Build smaller images with multistage builds and remove unnecessary tooling” instead of the stated acceptance requirement. The matching action is to set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Its confirming test is to deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

C:

This action and check address the distinct objective “Choose Ingress or Gateway API with an implementing controller for HTTP exposure” instead of the stated acceptance requirement. The matching action is to set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Its confirming test is to deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

D:

This action and check address the distinct objective “Understand resource quotas and LimitRanges for namespace capacity governance” instead of the stated acceptance requirement. The matching action is to set runAsNonRoot, suitable user IDs and drop unneeded Linux capabilities rather than assuming every container requires root. Its confirming test is to deploy a test Pod with runAsNonRoot and verify its effective user and capability sets while confirming app file permissions work.

Kubernetes and Cloud Native Associate (KCNA) Practice Tests