# Free KCNA practice questions

> 10 free KCNA practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/kubernetes-and-cloud-native-associate/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/kubernetes-and-cloud-native-associate/

### Question 1 of 10

Node memory runs low and the kubelet must evict Pods. Pod A is BestEffort, Pod B is Burstable and using more memory than it requested, and Pod C is Guaranteed. In what order are they most likely to be evicted?

- A. B first, then A, then C, because Burstable Pods are over their requests
- B. A first, then B, then C, based on QoS and usage above requests
- C. C first, then B, then A, because Guaranteed Pods use the most memory
- D. All three are evicted together, because eviction ignores QoS classes

**Answer:** B

**Explanation:** Under memory pressure the kubelet ranks Pods by whether usage exceeds requests, then priority, then usage relative to requests; in practice BestEffort Pods go first, then Burstable Pods exceeding requests, and Guaranteed Pods last. Guaranteed Pods are the most protected, not the first to go. Eviction is ordered rather than all at once, and BestEffort usage always exceeds its zero request, so it ranks ahead of the Burstable Pod.

### Question 2 of 10

Replicas of a front-end Deployment keep landing on the same node, so a single node failure takes down the whole service. Which scheduling feature spreads them across nodes?

- A. A nodeSelector naming one specific node for every replica
- B. Pod anti-affinity using topologyKey kubernetes.io/hostname
- C. A higher PriorityClass so the scheduler picks emptier nodes
- D. A toleration for the node.kubernetes.io/unreachable taint

**Answer:** B

**Explanation:** Pod anti-affinity against Pods with the same labels, keyed on kubernetes.io/hostname, prevents (or discourages) two replicas on one node; topologySpreadConstraints are an alternative. A toleration for the unreachable taint only controls how long Pods stay on a failed node. Priority affects preemption rather than spreading, and a nodeSelector naming one node concentrates Pods instead of spreading them.

### Question 3 of 10

Every container in a Pod has CPU and memory requests equal to its limits. Which QoS class does Kubernetes assign to the Pod?

- A. System-critical
- B. Burstable
- C. BestEffort
- D. Guaranteed

**Answer:** D

**Explanation:** When every container sets requests equal to limits for both CPU and memory, the Pod is classed as Guaranteed and is the last to be evicted under node pressure. Burstable applies when at least one container sets a request or limit but the Guaranteed rule is not met. BestEffort means no requests or limits at all, and Critical is not a QoS class (criticality is expressed through PriorityClasses).

### Question 4 of 10

An application Pod needs a log-shipping helper that starts before the main container, keeps running alongside it for the Pod's lifetime, and is stopped after the main container exits. Which modern Kubernetes pattern supports this natively?

- A. A second app container that is started with a postStart lifecycle hook
- B. An init container with restartPolicy: Always, acting as a native sidecar
- C. An ephemeral container added with kubectl debug after the Pod starts
- D. A regular init container that runs the shipper once and then exits cleanly

**Answer:** B

**Explanation:** Native sidecars are init containers with restartPolicy: Always; they start in init order, keep running for the Pod's lifetime and are terminated after the main containers. A regular init container must exit before app containers start. An ordinary second container has no startup or shutdown ordering guarantee, and ephemeral containers are for interactive debugging, not permanent helpers.

### Question 5 of 10

A multi-tenant cluster must run untrusted customer code with stronger isolation than standard runc containers, while still using normal Pod specs. Which approach fits?

- A. Run the Pods in the kube-system namespace for tighter control
- B. Set hostPID: true so processes can be monitored more closely
- C. Use a RuntimeClass selecting a sandboxed runtime such as gVisor or Kata
- D. Disable the container's seccomp profile to avoid syscall conflicts with the sandbox

**Answer:** C

**Explanation:** RuntimeClass lets a Pod choose a different runtime handler, and sandboxed runtimes such as gVisor (user-space kernel) or Kata Containers (lightweight VMs) add a strong isolation boundary. hostPID weakens isolation by sharing the node's process namespace. kube-system holds system components and offers no extra isolation, and disabling seccomp removes a protection layer.

### Question 6 of 10 (choose 2)

Which two statements about Kubernetes Secrets are correct? (Choose two.)

- A. Secret values in manifests are base64-encoded, which is an encoding rather than encryption
- B. Secrets can only be consumed as environment variables, never as mounted files
- C. Encryption at rest for Secrets in etcd can be enabled through an API server EncryptionConfiguration
- D. A Secret created in one namespace is readable by Pods in all other namespaces
- E. Secrets are encrypted with the cluster CA key automatically when they are created

**Answer:** A, C

**Explanation:** Base64 is only an encoding, so anyone who can read the object can decode the value; real protection comes from RBAC and from enabling encryption at rest with an EncryptionConfiguration (optionally backed by a KMS provider). Kubernetes does not encrypt Secrets with the CA key by default. Secrets can be mounted as files or used as environment variables, and they are namespaced, so Pods can only reference Secrets in their own namespace.

### Question 7 of 10

A StatefulSet's Pods use a StorageClass backed by zonal disks. Sometimes a Pod stays Pending because its volume was created in a zone where the Pod cannot be scheduled. Which StorageClass setting addresses this?

- A. reclaimPolicy: Retain on the StorageClass
- B. volumeBindingMode: Immediate
- C. volumeBindingMode: WaitForFirstConsumer
- D. allowVolumeExpansion: true

**Answer:** C

**Explanation:** WaitForFirstConsumer delays binding and provisioning until a Pod using the claim is scheduled, so the volume is created in a zone that satisfies the Pod's constraints. Immediate is the behaviour causing the problem because the volume is provisioned before scheduling. Retain controls what happens after the claim is deleted, and volume expansion only allows resizing.

### Question 8 of 10

During a rolling update, the new Pods fail their readiness probe. What happens to the old Pods under the default Deployment strategy?

- A. They keep serving because the rollout stalls on unready new Pods
- B. They are scaled to zero and the Deployment rolls back automatically
- C. They are converted into the new version in place by the kubelet
- D. They are deleted immediately so the new version can take over

**Answer:** A

**Explanation:** RollingUpdate respects maxUnavailable, so old Pods are removed only as new Pods become Ready; unready new Pods stall the rollout and old Pods keep serving. Old Pods are not deleted all at once (that is the Recreate strategy). Pods are not mutated in place, and Kubernetes does not roll back automatically; you run kubectl rollout undo or rely on progressDeadlineSeconds to mark the rollout as failed.

### Question 9 of 10

A team wants to send 5% of production traffic to a new version, watch error rates, and then increase the share step by step with automatic rollback on failure. Which approach fits best?

- A. A blue-green switch that moves all traffic at once
- B. A canary rollout managed by a progressive delivery tool like Argo Rollouts
- C. A Recreate Deployment strategy with a manual approval gate
- D. A rolling update with maxSurge set to 5% and maxUnavailable set to 0 on the Deployment

**Answer:** B

**Explanation:** Progressive delivery tools such as Argo Rollouts or Flagger shift weighted traffic in steps, analyse metrics and roll back automatically, which is exactly a canary rollout. Recreate stops all old Pods before starting new ones. Blue-green switches traffic all at once, and a rolling update replaces Pods by count without metric analysis or precise traffic weights.

### Question 10 of 10 (choose 2)

Which two are maturity levels that the CNCF assigns to hosted projects? (Choose two.)

- A. Enterprise
- B. Graduated
- C. Sandbox
- D. Long-term support
- E. Certified

**Answer:** B, C

**Explanation:** CNCF projects enter at Sandbox, move to Incubating and can reach Graduated as adoption, governance and security maturity grow. Certified relates to conformance programmes such as Certified Kubernetes, not project maturity. Long-term support and Enterprise are release or product labels used by vendors, not CNCF maturity levels.

Ready for a timed run? Take the free 15-question KCNA mini exam: https://devopscodelab.com/app/exams/kubernetes-and-cloud-native-associate/mini/

DevOpsCode Lab is not affiliated with CNCF. KCNA and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
