KCNA sample questions with answers
10 free KCNA sample questions across the exam's domains, each with its answer and an explanation. No account needed.
KCNA sample questions
Kubernetes and Cloud Native Associate (KCNA), CNCF / The Linux Foundation.
Question 1
Domain: Kubernetes Fundamentals
Which Pod field tells Kubernetes to have a custom scheduler, rather than the default one, place the Pod?
- spec.priorityClassName
- spec.nodeName
- spec.schedulerName
- metadata.annotations.scheduler
Show the answer
Answer: C. spec.schedulerName
spec.schedulerName selects which scheduler is responsible for the Pod; when unset it is default-scheduler. spec.nodeName skips scheduling entirely rather than choosing a different scheduler.
Checked against: https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/
Question 2
Domain: Kubernetes Fundamentals
A team keeps manifests in Git and wants a pipeline step that creates missing objects and updates existing ones each time it runs, without errors when objects already exist.
Which command meets this requirement?
- kubectl apply -f manifests/
- kubectl create -f manifests/
- kubectl replace --force -f manifests/
- kubectl run -f manifests/
Show the answer
Answer: A. kubectl apply -f manifests/
kubectl apply is declarative: it creates objects that do not exist and patches ones that do, so it can be re-run safely from a pipeline. kubectl create is imperative and fails with AlreadyExists on the second run, while replace --force deletes and recreates objects, causing avoidable disruption.
Checked against: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/
Question 3
Domain: Kubernetes Fundamentals
In requiredDuringSchedulingIgnoredDuringExecution, what does the IgnoredDuringExecution part mean?
- The rule is ignored while the Pod is being scheduled
- If node labels change after the Pod is placed, the Pod keeps running there
- The rule only applies to Pods created by Jobs
- The kubelet re-checks the rule and evicts the Pod if it no longer matches
Show the answer
Answer: B. If node labels change after the Pod is placed, the Pod keeps running there
The rule must be satisfied when the Pod is scheduled, but later changes to node labels do not cause the Pod to be evicted. Expecting the kubelet to re-evaluate and evict is the common misreading; that behaviour would require a different rule type.
Checked against: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
Question 4
Domain: Kubernetes Fundamentals
In a Kubernetes object, what is the difference between spec and status?
- spec is generated by controllers from defaults; status is written by the user in the manifest
- spec holds labels and annotations; status holds the container definitions
- Both hold desired state; status is just a read-only copy of spec
- spec describes the desired state; status reports the current state observed by the system
Show the answer
Answer: D. spec describes the desired state; status reports the current state observed by the system
Users declare desired state in spec, and Kubernetes components update status to describe what is actually happening; controllers work to close the gap between them. Reversing the two is a common mistake: users do not write status, and controllers do not author spec on behalf of the user.
Checked against: https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/
Question 5
Domain: Container Orchestration
A frontend Pod in the web namespace must call a ClusterIP Service named api that lives in the shop namespace. The cluster uses the default cluster domain.
Which DNS name should the frontend use?
- api.svc.cluster.local
- api.cluster.local.shop
- api.shop.svc.cluster.local
- shop.api.svc.cluster.local
Show the answer
Answer: C. api.shop.svc.cluster.local
Service DNS names follow <service>.<namespace>.svc.<cluster-domain>, so with the default cluster.local domain the name is api.shop.svc.cluster.local (and the short form api.shop also resolves). A bare name such as api would only work from within the shop namespace itself.
Checked against: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
Question 6
Domain: Container Orchestration
A Pod keeps restarting. kubectl describe pod shows Last State: Terminated, Reason: OOMKilled, Exit Code: 137.
What does this tell you, and what is the fix?
- The node's CPU was exhausted; add a CPU limit
- The container exceeded its memory limit; raise the limit or fix the memory use
- The liveness probe timed out repeatedly; increase its timeoutSeconds and failureThreshold
- The image is corrupt; pull it again with imagePullPolicy: Always
Show the answer
Answer: B. The container exceeded its memory limit; raise the limit or fix the memory use
Reason OOMKilled with exit code 137 (128 + SIGKILL) means the kernel killed the container for exceeding its memory limit, so the limit must match real needs or the leak must be fixed. A liveness failure would show a probe event and a normal termination reason instead.
Checked against: https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/
Question 7
Domain: Container Orchestration
A platform team runs a shared Gateway named public in the infra namespace. An application team wants requests for /orders on that Gateway to reach their orders Service, without touching the Gateway itself.
Which Gateway API resource should the application team create?
- GatewayClass
- Gateway
- Ingress
- HTTPRoute
Show the answer
Answer: D. HTTPRoute
The Gateway API separates roles: infrastructure providers define GatewayClasses, cluster operators run Gateways, and application developers attach HTTPRoutes to those Gateways to describe their routing. Creating another Gateway would mean provisioning new listeners, which is the operators' responsibility here.
Checked against: https://kubernetes.io/docs/concepts/services-networking/gateway/
Question 8
Domain: Cloud Native Application Delivery
A new version changes the on-disk data format in an incompatible way, so old and new versions of the application must never run at the same time.
Which Deployment strategy should they use?
- Recreate
- RollingUpdate with maxUnavailable: 0
- RollingUpdate with maxSurge: 100%
- A canary with 10% traffic
Show the answer
Answer: A. Recreate
Recreate terminates all existing Pods before creating new ones, so old and new versions never run at the same time, at the cost of brief downtime. Every rolling or canary approach by design runs both versions side by side for a while.
Checked against: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
Question 9
Domain: Cloud Native Application Delivery
Before a risky change, a reviewer wants to see the differences between the manifests in deploy/ and what is currently running.
Which command shows exactly what would change in the live cluster before applying?
- kubectl apply -f deploy/ --validate=true
- kubectl diff -f deploy/
- kubectl get -f deploy/ -o yaml
- kubectl describe -f deploy/
Show the answer
Answer: B. kubectl diff -f deploy/
kubectl diff sends the manifests to the server as a dry run and shows the difference from the live objects. kubectl get -o yaml only prints the current live state, leaving the reviewer to compare by hand.
Checked against: https://kubernetes.io/docs/reference/kubectl/generated/kubectl_diff/
Question 10
Domain: Cloud Native Architecture
A contributor wants to add a significant new user-facing field to the Pod API in upstream Kubernetes.
What is the expected route for this proposal?
- Write a Kubernetes Enhancement Proposal (KEP), sponsored by the owning SIG
- Open a pull request against the main branch and ask for a quick merge
- Email the CNCF Governing Board for approval
- Submit it to the CNCF Technical Oversight Committee as a new project
Show the answer
Answer: A. Write a Kubernetes Enhancement Proposal (KEP), sponsored by the owning SIG
Significant user-facing changes to Kubernetes are tracked as KEPs in the kubernetes/enhancements repository and owned by the relevant Special Interest Group, which reviews the design and graduation criteria. The CNCF Technical Oversight Committee governs CNCF projects as a whole and does not approve individual Kubernetes features.
Checked against: https://github.com/kubernetes/enhancements
More practice
A 20-question practice sampler is free with an account; Pro adds the full question bank and timed mock exams.
KCNA course and practice exam: Kubernetes and Cloud Native Associate: the exam guide, with the format, cost, pass mark and domains from the vendor.