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

Free Linux Foundation Certified Kubernetes Application Developer CKAD Exam Questions

Last updated: · 10 practice questions with answers and explanations

Page: 1 / 8 Total 48 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Application Design and Build

Skill tested: Update a Deployment image while preserving its selector and rollout configuration.

A team publishes a security-patched image for its web application as `registry.example.com/portal:2.4.1`. The running Deployment is named `portal` in namespace `apps`; its existing Pod template, labels, probes, and resource settings have been reviewed and must remain unchanged. The release process requires Kubernetes to manage replacement Pods through the existing Deployment rather than creating a second workload. Which action most directly applies the new image version while retaining the existing workload configuration?

Correct Answer: C. Patch the existing Deployment's Pod template container image to `registry.example.com/portal:2.4.1`.
Explanation:

Changing the image in the existing Deployment's Pod template creates a new revision, and the Deployment controller replaces Pods according to its rollout strategy. This preserves the reviewed template settings and keeps the existing workload in control. A second Deployment creates a separate workload rather than updating the existing one. Changing an individual Pod does not update its owning Deployment's template, so reconciliation can restore the old specification. Adding another container changes the application composition instead of replacing the application version.

Question 2

New Single answer

Topic: Application Deployment

Skill tested: Configure Deployment rolling-update limits to control availability and surge capacity.

An online booking service runs 10 replicas in a Deployment. During a release, the service must retain at least 8 available replicas, and the cluster has capacity for no more than 3 additional Pods while old Pods are being replaced. The team wants Kubernetes to perform a rolling update, not terminate every old Pod before starting replacements. Which rolling-update configuration satisfies both limits?

Correct Answer: D. Set `maxUnavailable` to 2 and `maxSurge` to 3.
Explanation:

With 10 desired replicas, `maxUnavailable: 2` allows at most two replicas to be unavailable during the rollout, preserving at least eight available replicas. `maxSurge: 3` caps the number of additional Pods above the desired count at three. Setting a surge of four violates the cluster-capacity constraint. A maximum unavailability of three risks dropping below the required availability, while a surge of zero can still be valid in some configurations but does not meet the stated requirement to use available extra capacity; it is not the configuration that satisfies both operational limits as specified.

Question 3

New Multiple answers

Topic: Application Deployment

Skill tested: Implement a canary rollout using a separately managed Deployment and Service selectors.

A payments team wants to expose a new application version to a small fraction of requests before replacing the stable version. Both versions must run concurrently, and no service mesh, ingress traffic-splitting feature, or external load balancer weighting is available. The existing ClusterIP Service selects Pods with `app: payments`. The stable Deployment has five replicas. Which two actions create a Kubernetes-primitives-based canary while keeping both versions reachable through that Service? Select TWO.

Correct Answer: C. Create a separate canary Deployment with the same `app: payments` Pod label and a distinct version label, initially using one replica.; D. Use a canary Deployment whose Pods retain `app: payments`, so they are eligible endpoints for the existing Service.
Explanation:

A separate canary Deployment lets the team control the new version's replica count independently. Giving its Pods the Service's existing `app: payments` label makes them eligible endpoints alongside stable Pods; a one-replica canary and five stable replicas provides a limited, approximate share of traffic through ordinary Service endpoint selection. This does not provide precise percentage weighting, but it is the available primitive under the constraints. Changing the Service selector to canary-only excludes stable Pods. Zero replicas receive no traffic, and changing the stable image eliminates the concurrent-version canary.

Question 4

New Single answer

Topic: Application Observability and Maintenance

Skill tested: Choose readiness and liveness probes that separate traffic eligibility from process recovery.

A containerized API starts quickly but then requires up to 45 seconds to load its local routing table. During that interval it must not receive Service traffic. After startup, the process can become deadlocked while continuing to run, and restarting it is the intended recovery. The team wants Kubernetes to avoid premature restarts during initialization while still detecting later deadlocks. Which probe design best meets these requirements?

Correct Answer: C. Configure a readiness probe for routing-table readiness and a liveness probe with a `startupProbe` allowance for initialization.
Explanation:

Readiness controls whether a Pod is considered ready to receive Service traffic, so checking that the routing table is loaded prevents premature routing. Liveness detects a process that is running but no longer healthy and can trigger a restart. A `startupProbe` gives slow initialization time to complete before liveness evaluation begins, avoiding restart loops during the 45-second load. A listening-port check may pass before the application is ready. Readiness alone does not restart deadlocked containers, and checking only process existence cannot detect the stated failures.

Question 5

New Single answer

Topic: Application Observability and Maintenance

Skill tested: Use kubectl logs and Pod status details to diagnose container failures.

After a release, a Pod in namespace `store` repeatedly restarts. Its status shows `CrashLoopBackOff`, and the current container log contains only startup messages because the process exits before reporting the failure. The Pod has not been replaced, and its container has restarted at least once. The on-call engineer needs the previous container instance's output before changing the manifest. Which command is the most appropriate first diagnostic action?

Correct Answer: C. `kubectl logs store-api -n store --previous`
Explanation:

`kubectl logs POD --previous` retrieves logs from the previous terminated container instance, which is the relevant output when the current instance has only startup messages and the container has restarted. The command assumes `store-api` is the Pod name as given in the scenario. Ordinary `kubectl logs` retrieves the current instance's logs. Describing a Deployment can show workload events but not the prior container's standard output, and watching namespace events does not recover that output.

Question 6

New Multiple answers

Topic: Application Environment, Configuration and Security

Skill tested: Expose ConfigMap and Secret values to containers using distinct Kubernetes mechanisms.

A reporting application consumes a non-sensitive `LOG_LEVEL` setting and a sensitive database password. The team wants to update configuration independently from the image, avoid embedding credentials in the image or source repository, and keep the password out of a plain-text configuration file mounted from a ConfigMap. The container accepts environment variables and can also read files. Which two approaches meet these requirements? Select TWO.

Correct Answer: A. Store `LOG_LEVEL` in a ConfigMap and expose it to the container through an environment variable or mounted ConfigMap volume.; D. Store the database password in a Secret and expose it through a Secret-backed environment variable or mounted Secret volume.
Explanation:

A ConfigMap is intended for non-confidential configuration and can be consumed as environment variables or files. A Secret is the appropriate Kubernetes object for the database password and can likewise be exposed through an environment variable or mounted volume. Secret data is not automatically encrypted merely because it is stored in a Secret, so cluster access controls and encryption-at-rest configuration remain important, but this avoids placing credentials in the image or ConfigMap. Putting the password in a ConfigMap fails the stated separation, baking values into the image ties them to releases, and ConfigMaps are supported as container configuration.

Question 7

New Single answer

Topic: Application Environment, Configuration and Security

Skill tested: Assign a least-privilege ServiceAccount to a Pod through its Pod specification.

A batch worker in namespace `finance` calls the Kubernetes API to read a specific ConfigMap. The platform team has created a dedicated ServiceAccount named `config-reader` and granted it the necessary namespaced read permission. The Pod is currently using the namespace's default ServiceAccount, which has no such permission. The team wants the worker to use only the dedicated identity and does not want to grant permissions to the default account. What change should be made?

Correct Answer: D. Add `serviceAccountName: config-reader` to the Pod specification and keep the Pod in namespace `finance`.
Explanation:

A Pod selects its Kubernetes API identity with `spec.serviceAccountName`. Because the ServiceAccount and its granted namespaced permissions are in `finance`, the Pod must use that ServiceAccount in the same namespace. `runAsUser` controls the operating-system user inside the container, not the Kubernetes API identity. An arbitrary annotation does not select a ServiceAccount, and manually creating and mounting a Secret is neither necessary nor a replacement for assigning the ServiceAccount in the Pod specification.

Question 8

New Multiple answers

Topic: Application Environment, Configuration and Security

Skill tested: Set CPU and memory requests and limits to support scheduling and constrain container use.

A namespace runs a latency-sensitive API container alongside less predictable workloads. Measurements show it needs at least 250 millicores and 256 MiB of memory for reliable scheduling decisions. The platform also requires a hard ceiling of 1 CPU and 512 MiB per container to prevent unbounded consumption. The team wants Kubernetes scheduling to account for the minimum requirement and runtime enforcement to cap usage. Which two resource settings should it apply to the container? Select TWO.

Correct Answer: A. Set CPU and memory requests to `250m` and `256Mi`.; E. Set CPU and memory limits to `1` and `512Mi`.
Explanation:

Requests describe the resources Kubernetes uses when placing a Pod, so setting `250m` CPU and `256Mi` memory reflects the measured minimum. Limits constrain container resource consumption at runtime, so the required ceilings are `1` CPU and `512Mi` memory. Using the minimum values as limits would impose a lower cap than intended; using the ceilings as requests can make placement unnecessarily restrictive. Requests alone do not enforce a runtime ceiling, and a CPU-only request does not account for the stated memory requirement.

Question 9

New Single answer

Topic: Services and Networking

Skill tested: Expose Deployment Pods through a Service using stable label selectors and ports.

A team has a Deployment named `catalog` whose Pods carry the label `app: catalog`. The application listens on TCP port 8080, but clients in the cluster should connect to a stable Service port of 80 while the team replaces Pods during releases. There is no requirement for external access. Which Service configuration provides the intended connectivity?

Correct Answer: B. Create a `ClusterIP` Service with selector `app: catalog`, `port: 80`, and `targetPort: 8080`.
Explanation:

A ClusterIP Service provides stable in-cluster access without exposing the application externally. Its selector matches the Deployment Pods, while `port: 80` is the client-facing Service port and `targetPort: 8080` forwards connections to the application listener. A NodePort exposes a node-level port unnecessarily and the proposed port mapping does not express the required client port. ExternalName does not select Pods or proxy to their endpoints. Mapping both ports to 80 would send traffic to a port where the application is not listening.

Question 10

New Single answer

Topic: Services and Networking

Skill tested: Restrict Pod ingress with NetworkPolicy selectors and permitted source traffic.

A namespace contains Pods labeled `role: api` and `role: frontend`. By default, the cluster permits Pod-to-Pod traffic. A new policy must allow API Pods to receive traffic only from frontend Pods in the same namespace on TCP port 8080; it must not block the API Pods' existing egress. The policy should apply only to the API Pods. Which NetworkPolicy design meets these requirements?

Correct Answer: D. Select `role: api`, include `Ingress` in `policyTypes`, and allow ingress from Pods labeled `role: frontend` on TCP port 8080.
Explanation:

A NetworkPolicy applies to the Pods selected by `podSelector`, so selecting `role: api` targets the intended receivers. An ingress rule with a peer selector for `role: frontend` and TCP port 8080 permits the specified source-to-destination traffic. Restricting only ingress leaves egress unchanged; when no egress policy selects these Pods, their existing egress remains unaffected. Selecting frontend Pods reverses the policy target, adding an egress policy is unnecessary, and allowing all sources and ports is broader than required.