Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free Linux Foundation Kubernetes and Cloud Native Associate KCNA Exam Questions

Last updated: · 10 practice questions with answers and explanations

Page: 1 / 16 Total 240 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Kubernetes Fundamentals

Skill tested: Select how Deployments, Pods, and Services provide resilient application access.

A team runs a stateless HTTP application on Kubernetes. It needs three interchangeable replicas, automatic replacement when a replica fails, and a stable in-cluster address for clients even as individual Pods are recreated. The team does not need external access yet. Which design best meets these requirements while keeping replica management declarative?

Correct Answer: D. Create a Deployment with three replicas and a Service whose selector matches the Pods' labels.
Explanation:

A Deployment maintains the desired number of replicas and replaces Pods that fail; recreated Pods can receive different IP addresses. A Service selects the matching Pods by labels and provides a stable virtual IP and DNS name for clients. Standalone Pods in A are not managed as a replica set, and their IPs are not a durable client interface. C requires manually maintaining endpoints and does not provide declarative replica management. D neither maintains three replicas nor makes a Pod's identity stable; NodePort is unnecessary for in-cluster access.

Question 2

New Single answer

Topic: Kubernetes Fundamentals

Skill tested: Diagnose why a Kubernetes Service has no usable endpoints.

A deployment rollout has completed, and the application Pods are running and Ready. However, requests sent to the application's ClusterIP Service time out. The Service port and targetPort match the container's listening port, and DNS resolves the Service name. The Service selector is `app: catalog`, while the Pods carry the label `app: catalogue`. What is the most appropriate corrective action?

Correct Answer: D. Change the Service selector to match the Pods' `app: catalogue` label.
Explanation:

A Service routes to endpoints selected by its selector. Because `app: catalog` does not match the Pods' `app: catalogue` label, the Service has no matching endpoints despite correct DNS and port configuration. Updating the selector to match makes the Ready Pods eligible endpoints. NodePort changes how a Service is exposed, not how it selects Pods. Adding a readiness probe does not repair the label mismatch, and cycling replicas cannot change the selector relationship.

Question 3

New Multiple answers

Topic: Kubernetes Fundamentals

Skill tested: Choose workload and service settings for controlled, health-aware application rollouts.

A payments team wants to release a stateless API without planned downtime. It must keep the previous ReplicaSet available during a rollout, send client traffic only to Pods that are ready to serve, and allow Kubernetes to maintain the desired replica count. The API is consumed only inside the cluster. Select TWO changes that directly satisfy these requirements.

Correct Answer: A. Manage the API with a Deployment and configure the desired replica count.; B. Use a readiness probe so unready Pods are not considered ready endpoints.
Explanation:

A Deployment manages a desired replica count and performs rolling updates using ReplicaSets, enabling controlled replacement rather than requiring manually managed Pods. A readiness probe reports whether a container can serve requests; Pods that are not Ready are excluded from normal Service traffic. NodePorts and per-Pod client tracking are unnecessary and brittle for an in-cluster API. Manually created Pods do not provide the desired Deployment rollout and replica management. A headless Service changes service discovery behavior but does not manage application rollouts or make readiness unnecessary.

Question 4

New Single answer

Topic: Kubernetes Fundamentals

Skill tested: Apply namespace-scoped least privilege to Kubernetes service accounts.

A reporting Pod needs to read ConfigMaps only in its own namespace. The organization requires least privilege and wants the permission to apply to Pods using a dedicated identity, not every workload in the namespace. Which configuration is the best fit?

Correct Answer: B. Create a namespace-scoped Role allowing ConfigMap reads, bind it with a RoleBinding to a dedicated ServiceAccount, and assign that account to the Pod.
Explanation:

A Role limits permissions to its namespace, while a RoleBinding grants those permissions to a specific subject. Assigning a dedicated ServiceAccount to the Pod applies the least-privilege access only to that workload identity. A grants excessive cluster-wide privilege to a shared default identity. C is also broader than necessary because it permits reads across resource types and potentially namespaces. D exposes powerful credentials to the workload and bypasses Kubernetes' intended scoped authorization model.

Question 5

New Multiple answers

Topic: Container Orchestration

Skill tested: Select Kubernetes network and storage choices for isolation and durable Pod data.

A stateful analytics service runs in a namespace with other teams' workloads. Its data must survive a Pod replacement, and the platform team wants to prevent this namespace's Pods from initiating connections to other Pods unless explicitly allowed. Storage is provided by a cluster StorageClass, and network policy enforcement is available. Select TWO appropriate choices.

Correct Answer: C. Use a NetworkPolicy selecting the namespace's Pods with default-deny egress, then add rules for required destinations.; E. Use a PersistentVolumeClaim for the data and mount it into the application Pod.
Explanation:

A PersistentVolumeClaim requests persistent storage from the configured storage system; mounting the claim lets data outlive the individual Pod, subject to the storage system's behavior and access mode. A NetworkPolicy can select Pods and restrict egress, with explicit allowances for required destinations; enforcement depends on the cluster network implementation, which the scenario provides. Container writable layers are ephemeral, and a Deployment does not preserve their contents. Host networking affects network namespace use, not data durability. A LoadBalancer Service neither provides persistent storage nor enforces egress policy.

Question 6

New Single answer

Topic: Container Orchestration

Skill tested: Choose persistent volume claims to retain application data across Pod replacement.

A small media service stores uploaded files locally. The team currently mounts an `emptyDir`, so files disappear when a Pod is deleted. The application can run one replica, and the cluster has a StorageClass that provisions a volume for a claim. The team wants Kubernetes to attach requested storage to the Pod without binding the workload to a node's local filesystem path. What should it do?

Correct Answer: B. Replace `emptyDir` with a PersistentVolumeClaim and mount the claim at the upload directory.
Explanation:

A PersistentVolumeClaim requests storage independently of a particular Pod and can be provisioned through the available StorageClass. Mounting it at the upload path allows the application to use persistent storage across Pod replacement, subject to the volume's lifecycle and storage semantics. `emptyDir` is tied to the Pod's lifetime. `hostPath` ties data to a node and is explicitly contrary to the requirement. More replicas do not copy or preserve a deleted Pod's local files. ConfigMaps are intended for configuration data, not application uploads.

Question 7

New Single answer

Topic: Container Orchestration

Skill tested: Troubleshoot Pod-to-Pod reachability using Kubernetes Service discovery and networking.

A frontend Pod can resolve the DNS name of a backend Service, but its requests fail. The backend Pods are Ready, the Service selector matches their labels, and the Service has endpoints. The frontend and backend run in different namespaces, and the request uses only the short name `orders`. The cluster has no NetworkPolicy restrictions. What should the operator try first?

Correct Answer: A. Use the backend Service's fully qualified DNS name, such as `orders.backend.svc.cluster.local`.
Explanation:

A short Service name is resolved relative to the querying Pod's namespace search context. Since the frontend and Service are in different namespaces, using `orders` can resolve incorrectly or fail to identify the backend Service. The Service's fully qualified DNS name explicitly identifies its namespace and cluster domain. ClusterIP Services are reachable across namespaces by default when networking permits, so NodePort is not required. Host networking does not correct the DNS name, and a headless Service does not remove namespace-qualified DNS behavior.

Question 8

New Single answer

Topic: Cloud Native Application Delivery

Skill tested: Choose Ingress for host-based HTTP routing to in-cluster Services.

A company operates several HTTP applications in one cluster and owns a single public IP address. Each application should be reached through a different hostname, and TLS should terminate at the cluster edge. The team wants one shared HTTP entry point rather than allocating a public address per application. Which approach best meets the requirements?

Correct Answer: C. Create an Ingress with host-based rules targeting the application Services, and ensure an Ingress controller is installed and configured for TLS.
Explanation:

Ingress provides HTTP(S) routing rules, including host-based routing, to backend Services. An Ingress resource requires an Ingress controller to implement those rules; the controller can provide the shared external entry point and TLS handling when configured accordingly. Separate LoadBalancer Services can expose applications but conflict with the single-public-IP constraint. ClusterIP Services are not directly externally reachable, and Pod IPs are unsuitable stable public endpoints. NodePort alone does not provide host-based HTTP routing to different Services.

Question 9

New Multiple answers

Topic: Cloud Native Application Delivery

Skill tested: Select Kubernetes Service types for internal access and direct external node-port access.

A platform team is reviewing two services. An internal metrics service must be reachable only within the cluster. A separate demo application must be reachable from an external test network through a known node address and port; the team does not require a cloud load balancer or HTTP host-based routing. Select TWO appropriate Service configurations.

Correct Answer: C. Use ClusterIP for the metrics service.; E. Use NodePort for the demo application and permit access to the allocated node port from the test network.
Explanation:

ClusterIP is the default Service type and provides an in-cluster virtual IP, fitting the metrics service's internal-only requirement. NodePort exposes a Service on a port on each node, allowing the demo to be reached through a node address and that port, subject to network firewall access. LoadBalancer is intended to provision or integrate with an external load-balancing mechanism where supported and does not inherently make a service private. ExternalName provides DNS aliasing, not node-port exposure. Headless Services omit a ClusterIP and return endpoint records; they do not allocate stable external IP addresses.

Question 10

New Single answer

Topic: Cloud Native Architecture

Skill tested: Map application metrics, logs, and traces to appropriate cloud-native observability tools.

A product team has basic uptime checks but cannot distinguish high request latency from application errors or identify which downstream call causes a slow request. It wants to collect time-series measurements, retain searchable event records, and follow a request across multiple services. Which combination best maps these observability needs to commonly used cloud-native projects?

Correct Answer: B. Prometheus for metrics, Fluentd for log collection, and Jaeger for distributed tracing.
Explanation:

Prometheus is commonly used to collect and query metrics such as request rate, errors, and latency. Fluentd is a log collector that can route application and system logs to storage or analysis backends. Jaeger supports distributed tracing, which helps locate latency across service calls. The other combinations interchange the projects' primary observability roles: Jaeger is not a general metrics backend, Fluentd is not a tracing system, and Prometheus is not a log-storage or distributed-tracing solution.