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

Free Linux Foundation Certified Kubernetes Administrator CKA Exam Questions

Last updated: · 12 practice questions with answers and explanations

Page: 1 / 9 Total 83 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Storage

Skill tested: Configure StorageClass-backed PersistentVolumeClaims and validate their use by a Pod.

A team is moving a test workload to a cluster where the storage provisioner supports dynamic provisioning through the `fast-rwo` StorageClass. The workload needs a 6 GiB filesystem volume that can be mounted read-write by one Pod at a time. The claim must use this StorageClass, and the Pod must not start until its volume is attached and mounted. Which configuration is the best fit?

Correct Answer: D. Create a PVC requesting 6 GiB with `storageClassName: fast-rwo` and `accessModes: [ReadWriteOnce]`, then reference that claim from the Pod.
Explanation:

A PVC that requests 6 GiB, specifies the provisioner's StorageClass, and requests ReadWriteOnce can trigger dynamic provisioning and be mounted by the Pod. ReadWriteOnce expresses the single-node read-write requirement; it does not itself mean only one Pod can ever use the volume. ReadWriteMany in B asks for a capability that the scenario does not require and that the provisioner may not support. C mixes a manually created PV with a claim that does not select the stated class, and a Pod does not select PVs directly. `emptyDir` is ephemeral Pod storage, not a StorageClass-backed volume.

Question 2

New Multiple answers

Topic: Troubleshooting

Skill tested: Use Pod events, logs, and node status to isolate a container startup failure.

An API Deployment in a production namespace has one replica repeatedly entering `CrashLoopBackOff`; the other replicas are healthy. The affected Pod is assigned to a node that reports `Ready`. Its events show successful image pulls and container creation, followed by repeated restarts. The application log from the previous container instance reports that it cannot read `/etc/api/settings.yaml`. The Pod mounts a ConfigMap at `/etc/api`, but operators recently changed the ConfigMap key name. You must identify the immediate cause and make the smallest safe correction without changing the application image. Select TWO actions.

Correct Answer: C. Read the previous container's logs with `kubectl logs -c --previous` to verify the startup error.; D. Inspect the Pod's volume and `items` mapping against the current ConfigMap keys, then correct the mapping or key reference.
Explanation:

The previous-instance log provides direct evidence that the process cannot find its expected configuration file, while the changed ConfigMap key makes a volume key or `items` mapping mismatch a likely immediate cause. Inspecting both the previous logs and the mounted-volume configuration is the efficient diagnostic and corrective path. A Ready node and successful container creation do not indicate a node-level mounting failure. The reported error does not establish memory pressure, so raising the limit is unjustified. Recreating the ConfigMap without checking the mapping may not resolve a mismatch and risks overwriting valid configuration.

Question 3

New Single answer

Topic: Workloads & Scheduling

Skill tested: Configure Deployment rolling updates while preserving availability during application rollout.

A customer-facing service runs three replicas. During releases, the team must keep at least two Pods available and permit at most one extra Pod above the desired replica count. The application has a readiness probe, and the cluster has sufficient spare capacity for one surge Pod. The Deployment currently uses the default rolling update behavior, which can create more than one extra Pod for this workload. Which update strategy settings best meet the release requirements?

Correct Answer: D. Set `maxSurge: 1` and `maxUnavailable: 0`.
Explanation:

With three desired replicas, `maxUnavailable: 0` prevents the Deployment controller from reducing the number of available replicas below three during the rollout, assuming availability is correctly reflected by the readiness probe. `maxSurge: 1` allows exactly one additional Pod above the desired count, matching the capacity constraint. A allows an availability reduction and no surge. C could temporarily permit only two available replicas, violating the stated minimum. D preserves availability but allows two extra Pods, exceeding the surge limit.

Question 4

New Multiple answers

Topic: Cluster Architecture, Installation & Configuration

Skill tested: Apply least-privilege RBAC permissions for a user limited to one namespace.

A platform team grants an external auditor read-only access to inspect Pods and Services in the `audit` namespace. The auditor must not list Secrets, create or modify resources, or access other namespaces. The auditor authenticates as the Kubernetes user `reviewer`. Which TWO RBAC resources should the administrator create and bind?

Correct Answer: C. A RoleBinding in `audit` that references the Role and names `reviewer` as a user subject.; D. A Role in `audit` granting `get`, `list`, and `watch` on `pods` and `services` in the core API group.
Explanation:

A namespaced Role granting only read verbs on Pods and Services limits the auditor's permissions to the required resources and namespace. A RoleBinding in `audit` binds those permissions to the `reviewer` user; a RoleBinding can reference a Role in the same namespace. A ClusterRoleBinding would grant its referenced permissions cluster-wide, contrary to the boundary. The broad ClusterRole and wildcard Role expose Secrets or permit unwanted operations. Kubernetes RBAC is additive, so avoid attaching any broader binding to this user.

Question 5

New Single answer

Topic: Services & Networking

Skill tested: Diagnose ClusterIP reachability by verifying Service selectors and EndpointSlices.

A backend Deployment has three ready Pods labeled `app: catalog, tier: backend`. A ClusterIP Service named `catalog` exposes port 80 and targets container port 8080. Clients inside the cluster resolve `catalog` to the expected ClusterIP, but connections fail, and `kubectl get endpoints catalog` shows no addresses. The Service selector is `app: catalog, role: backend`. There are no NetworkPolicies, and the Pods listen on port 8080. What is the best next action?

Correct Answer: B. Change the Service selector to `app: catalog, tier: backend` so it matches the Pod labels.
Explanation:

A Service routes to Pods selected by its label selector. The current selector requires `role: backend`, but the Pods have `tier: backend`, so the Service has no endpoints even though DNS resolution returns the ClusterIP. Matching the selector to the existing Pod labels restores endpoint discovery without changing the workload. NodePort does not fix a selector mismatch. The Service port may differ from `targetPort`, so changing the target to 80 would direct traffic to the wrong listening port. Ingress routes HTTP(S) to Services; it does not replace this backend Service.

Question 6

New Single answer

Topic: Troubleshooting

Skill tested: Separate image-pull failures from application failures using Pod state and events.

A newly deployed batch worker remains in `ImagePullBackOff`. The Pod has not started a container, so it has produced no application logs. Events report that the registry returned an authentication error for the image `registry.example.net/ops/worker:v4`. Other Pods in the namespace can pull public images, and the worker image is private. Which is the best first corrective action?

Correct Answer: A. Check that the namespace has a valid registry Secret and that the Pod references it through `imagePullSecrets` or an applicable ServiceAccount.
Explanation:

The Pod has not started a container, and the event identifies registry authentication as the failure. The appropriate first step is to verify the Secret's credentials and namespace and confirm that the Pod or its ServiceAccount uses it for image pulls. CPU and memory requests do not authenticate to a registry. There can be no previous container logs when the image has not been pulled and started. Recreating the Pod with unchanged credentials is likely to repeat the same failure.

Question 7

New Multiple answers

Topic: Workloads & Scheduling

Skill tested: Inject ConfigMap and Secret values into a Deployment using distinct configuration sources.

A Deployment provides a payment service that reads a non-sensitive `LOG_LEVEL` setting and a database password from environment variables. The team wants to change ordinary settings without storing them in the Secret and restrict the password to the application configuration source. The application container already supports environment-variable configuration, and no file-based reload is required. Which TWO actions implement this separation?

Correct Answer: B. Store `LOG_LEVEL` in a ConfigMap and expose it to the container with `envFrom` or a specific `configMapKeyRef`.; D. Store the database password in a Secret and expose it with a `secretKeyRef`.
Explanation:

A ConfigMap is appropriate for non-confidential configuration such as `LOG_LEVEL`, while a Secret is the suitable Kubernetes object for the database password. `configMapKeyRef` or `envFrom` and `secretKeyRef` expose the respective values as environment variables supported by the application. Putting the password in a ConfigMap fails the requested separation. A broad permission to list Secrets is unnecessary for a Pod consuming a referenced Secret, and mounting a Secret as a volume does not automatically create environment variables.

Question 8

New Single answer

Topic: Cluster Architecture, Installation & Configuration

Skill tested: Join a kubeadm worker using a valid control-plane-generated bootstrap token and discovery hash.

A newly installed Linux worker must join an existing kubeadm cluster. The administrator has confirmed that the worker can reach the API server's advertised address and that its container runtime is running. A prior join attempt failed because the command used a placeholder for the CA certificate hash. The control plane can generate a fresh join command, and the worker must join as a worker rather than as a control-plane node. What should the administrator do next?

Correct Answer: C. Generate a fresh `kubeadm token create --print-join-command` on the control plane and run its complete command on the worker.
Explanation:

A kubeadm worker joins with `kubeadm join` using the API endpoint, a bootstrap token, and the correct discovery-token CA certificate hash. Generating the complete command on the control plane avoids repeating the invalid placeholder and supplies current join data. `kubeadm init` initializes a new control plane rather than joining a worker. `kubectl join` is not a Kubernetes command, and copying an administrative kubeconfig does not perform node bootstrap. The `--control-plane` option is for adding a control-plane node and requires additional setup, including the certificate key.

Question 9

New Multiple answers

Topic: Services & Networking

Skill tested: Configure an Ingress rule and verify routing through its installed controller.

A cluster hosts an HTTP application behind a ClusterIP Service named `portal` in namespace `web`, serving port 8080. External clients must reach it at `portal.example.org` over HTTP. An Ingress controller is already installed and running, but no external load balancer is available; clients can reach the controller through a node address. Which TWO actions are required to route requests successfully?

Correct Answer: A. Ensure the controller is reachable at the node address and configure client DNS or a test hosts entry for `portal.example.org` to resolve to that address.; B. Create an Ingress in namespace `web` with a host rule for `portal.example.org` and a path backend referencing Service `portal` on its Service port.
Explanation:

An Ingress rule routes matching HTTP host and path requests to a Service backend in the same namespace. The backend port must be a port exposed by `portal`, not necessarily the container's target port. Because no external load balancer exists, clients also need network reachability to the controller through the node address and DNS resolution of the requested host to that address. A second Service is unnecessary. Cross-namespace Service references are not supported by the standard Ingress backend model.

Question 10

New Single answer

Topic: Storage

Skill tested: Diagnose why a PVC remains Pending by matching its access mode to available storage.

A cluster administrator creates a 20 GiB PVC requesting `ReadWriteMany` and selects the `local-fast` StorageClass. The claim remains `Pending`; its events report that no matching persistent volume is available and that the provisioner cannot satisfy the requested access mode. The class provisions node-local storage that supports `ReadWriteOnce`, and the workload is a single Pod that will run on one node. The data does not need simultaneous mounts from multiple nodes. What is the most appropriate correction?

Correct Answer: B. Change the claim to `ReadWriteOnce` and retain the `local-fast` StorageClass.
Explanation:

The events identify an access-mode mismatch: the provisioner supports ReadWriteOnce, while the claim requests ReadWriteMany. Since the workload is a single Pod on one node and does not need multi-node shared writes, changing the claim to ReadWriteOnce aligns it with the provisioner's capability. Increasing capacity does not solve an unsupported access mode. Removing the StorageClass may select a different default or no provisioner at all, and `subPath` does not bypass PVC binding or storage access-mode requirements.

Question 11

New Multiple answers

Topic: Troubleshooting

Skill tested: Correlate node conditions, Pod events, and kubelet logs to diagnose scheduling and startup issues.

Several Pods on one worker are not becoming Ready. `kubectl describe node` shows `Ready=False` with a `KubeletNotReady` message about runtime communication. Pods on other nodes are healthy, and a newly scheduled Pod on the affected node reports sandbox creation failures. The control plane remains responsive. You have privileged access to the worker and must gather evidence before making a node-level change. Select TWO useful diagnostic actions.

Correct Answer: C. Inspect recent kubelet journal entries on the affected worker for runtime connection errors.; D. Inspect the node's container runtime service status and logs on that worker.
Explanation:

The node condition and sandbox creation events point to a kubelet-to-runtime problem on that worker. Kubelet journal entries and the runtime service status and logs provide evidence about connectivity, service health, and relevant errors before any repair is attempted. Deleting Pods does not address a node agent or runtime failure and can disrupt healthy workloads. Image tags concern container image retrieval or application startup, not sandbox creation. Pods do not need cluster-admin RBAC permissions to use the node's container runtime.

Question 12

New Single answer

Topic: Cluster Architecture, Installation & Configuration

Skill tested: Use kubeadm control-plane initialization with a consistent Pod network CIDR configuration.

An operations team is preparing the first control-plane node with kubeadm. Its selected CNI plugin requires the cluster Pod network to use `10.244.0.0/16`, and the team will install that plugin immediately after initialization. The Linux host's node address is on a separate network, and the API server must advertise the reachable node address. Which initialization approach best satisfies these requirements?

Correct Answer: B. Run `kubeadm init` with `--pod-network-cidr=10.244.0.0/16` and set `--apiserver-advertise-address` to the node's reachable control-plane address.
Explanation:

The Pod network CIDR supplied during kubeadm initialization should match the CNI's required cluster network, while the API server advertise address should be the control-plane node's reachable address. These are distinct network settings: the Pod CIDR is not the host's node subnet. B reverses those roles and can produce incompatible network configuration. `kubeadm join` is for adding a node to an existing cluster, not initializing the first control plane. kubeadm does not infer a CNI-specific Pod CIDR automatically.