KCNA

Free KCNA practice questions

10 questions from our KCNA practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.

Back to the KCNA practice exams

Question 1 of 10, Kubernetes Fundamentals

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?

  1. AB first, then A, then C, because Burstable Pods are over their requests
  2. BA first, then B, then C, based on QoS and usage above requests Correct answer
  3. CC first, then B, then A, because Guaranteed Pods use the most memory
  4. DAll three are evicted together, because eviction ignores QoS classes

Answer and 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, Kubernetes Fundamentals

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?

  1. AA nodeSelector naming one specific node for every replica
  2. BPod anti-affinity using topologyKey kubernetes.io/hostname Correct answer
  3. CA higher PriorityClass so the scheduler picks emptier nodes
  4. DA toleration for the node.kubernetes.io/unreachable taint

Answer and 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, Kubernetes Fundamentals

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

  1. ASystem-critical
  2. BBurstable
  3. CBestEffort
  4. DGuaranteed Correct answer

Answer and 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, Kubernetes Fundamentals

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?

  1. AA second app container that is started with a postStart lifecycle hook
  2. BAn init container with restartPolicy: Always, acting as a native sidecar Correct answer
  3. CAn ephemeral container added with kubectl debug after the Pod starts
  4. DA regular init container that runs the shipper once and then exits cleanly

Answer and 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, Container Orchestration

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?

  1. ARun the Pods in the kube-system namespace for tighter control
  2. BSet hostPID: true so processes can be monitored more closely
  3. CUse a RuntimeClass selecting a sandboxed runtime such as gVisor or Kata Correct answer
  4. DDisable the container's seccomp profile to avoid syscall conflicts with the sandbox

Answer and 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, Container Orchestration. Choose 2.

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

  1. ASecret values in manifests are base64-encoded, which is an encoding rather than encryption Correct answer
  2. BSecrets can only be consumed as environment variables, never as mounted files
  3. CEncryption at rest for Secrets in etcd can be enabled through an API server EncryptionConfiguration Correct answer
  4. DA Secret created in one namespace is readable by Pods in all other namespaces
  5. ESecrets are encrypted with the cluster CA key automatically when they are created

Answer and 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, Container Orchestration

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?

  1. AreclaimPolicy: Retain on the StorageClass
  2. BvolumeBindingMode: Immediate
  3. CvolumeBindingMode: WaitForFirstConsumer Correct answer
  4. DallowVolumeExpansion: true

Answer and 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, Cloud Native Application Delivery

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

  1. AThey keep serving because the rollout stalls on unready new Pods Correct answer
  2. BThey are scaled to zero and the Deployment rolls back automatically
  3. CThey are converted into the new version in place by the kubelet
  4. DThey are deleted immediately so the new version can take over

Answer and 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, Cloud Native Application Delivery

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?

  1. AA blue-green switch that moves all traffic at once
  2. BA canary rollout managed by a progressive delivery tool like Argo Rollouts Correct answer
  3. CA Recreate Deployment strategy with a manual approval gate
  4. DA rolling update with maxSurge set to 5% and maxUnavailable set to 0 on the Deployment

Answer and 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, Cloud Native Architecture. Choose 2.

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

  1. AEnterprise
  2. BGraduated Correct answer
  3. CSandbox Correct answer
  4. DLong-term support
  5. ECertified

Answer and 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.