Sign in
Home/Linux Foundation/Kubernetes and Cloud Native Associate (KCNA)/Free questions

Kubernetes and Cloud Native Associate (KCNA) — Free Practice Questions

10 free sample questions from a bank of 281, with the correct answers and explanations. No signup required — start practising right now.

1What native runtime is Open Container Initiative (OCI) compliant?
  • runC
  • runV
  • kata-containers
  • gvisor
Answer: A

The short version

A — runC is the OCI-compliant native runtime. It implements the Open Container Initiative specs for image and runtime. Alternatives build on it or add isolation with different scope.

Key concepts in this question

  • OCI standard: defines image format plus runtime contract so containers run portably across tools.
  • runC: reference low-level runtime that spawns containers per OCI, used by Docker and containerd.
  • runV contrast: hypervisor-based runtime path, not the canonical OCI reference.
  • Kata contrast: secure VM-wrapped workloads that use OCI layers but add guest kernels.
  • gVisor contrast: user-space kernel for sandboxing, compatible yet not the native reference.

Why A is correct

A is correct because runC was donated as the OCI reference implementation and directly embodies the runtime spec. Kubernetes and Docker stacks invoke runC through high-level shims to create namespaces and cgroups per standard. Kata and gVisor provide stronger isolation by interposing VMs or emulated kernels, while runV targets hypervisor flows. For native OCI compliance without extra sandbox, runC is the settled answer.

Why the others are wrong

  • B. runV focuses on hypervisor execution, not the baseline OCI reference runtime.
  • C. kata-containers adds VM isolation atop OCI, a hardened variant rather than the native core.
  • D. gvisor inserts a user-space kernel for filtering, a sandbox approach beyond native compliance.

KCNA exam tip

Native OCI equals runC. Kata equals VMs, gVisor equals user kernel, runV equals hypervisor variant.

2What function does kube-proxy provide to a cluster?
  • Implementing the Ingress resource type for application traffic.
  • Forwarding data to the correct endpoints for Services.
  • Managing data egress from the cluster nodes to the network.
  • Managing access to the Kubernetes API.
Answer: B

The short version

B — kube-proxy forwards Service traffic to correct endpoints. It programs node networking so virtual Service IPs reach healthy pods. Ingress, egress and API duties belong elsewhere.

Key concepts in this question

  • Service abstraction: stable virtual IP and DNS fronting ephemeral pod IPs.
  • Endpoint tracking: watches Service plus EndpointSlices to learn live pod addresses.
  • kube-proxy action: installs iptables or IPVS rules plus userspace fallback to load balance flows.
  • Ingress contrast: separate controller routes external HTTP host and path to Services.
  • API contrast: kube-apiserver serves control calls, not data forwarding.

Why B is correct

B is correct because kube-proxy runs on each node and ensures packets to a Service land on ready backends. It reconciles kernel forwarding tables as pods scale or move, providing cluster-wide load distribution for ClusterIP, NodePort and LoadBalancer flows. It does not implement Ingress HTTP routing, manage outbound gateway policy, or gate API auth. Forwarding data to endpoints is its documented data-plane role.

Why the others are wrong

  • A. describes Ingress controllers that parse host and path, not kube-proxy L4 forwarding.
  • C. describes egress gateways or CNI policy, not per-node Service load balancing.
  • D. describes API server auth and admission, a control-plane job distinct from proxying.

KCNA exam tip

Service to pods equals kube-proxy. Ingress equals HTTP routing, API equals control access.

3Which of these events will cause the kube-scheduler to assign a Pod to a node?
  • When the Pod crashes because of an error.
  • When a new node is added to the Kubernetes cluster.
  • When the CPU load on the node becomes too high.
  • When a new Pod is created and has no assigned node.
Answer: D

The short version

D — Scheduler assigns only fresh unscheduled pods. Its watch loop binds pending pods with no node to a fit host. Crashes, new nodes or load alone do not trigger binding.

Key concepts in this question

  • Pending state: new pod has empty spec nodeName and awaits placement decision.
  • Scheduling cycle: filters for feasibility then scores for best fit using resources and affinity.
  • Crash handling: kubelet restarts containers, scheduler does not reassign running pods on failure.
  • Node addition: may allow future pending pods to fit, but does not itself move existing pods.
  • Load response: descheduler or autoscaler may evict, fresh scheduling still starts from pending.

Why D is correct

D is correct because kube-scheduler watches for pods with no assigned node and selects a suitable node per constraints and capacity. A newly created pod enters pending and triggers exactly one binding. Crashes are handled locally by kubelet restart policy, new nodes merely expand capacity, and high CPU does not itself rebind. Only creation without assignment matches the scheduler activation condition.

Why the others are wrong

  • A. crash recovery uses kubelet restart, not a fresh schedule to another node.
  • B. node arrival adds options but scheduler acts only when a pending pod exists.
  • C. high CPU may prompt autoscaling, not automatic reassignment of running pods.

KCNA exam tip

Empty nodeName plus new pod equals scheduler. Crash equals kubelet, load equals autoscaler.

4Which resource do you use to attach a volume in a Pod?
  • StorageVolume
  • PersistentVolume
  • StorageClass
  • PersistentVolumeClaim
Answer: D

The short version

D — PersistentVolumeClaim attaches storage to a pod. It requests capacity and access from the cluster pool. PVs, classes and made-up volumes do not mount directly.

Key concepts in this question

  • Claim flow: user writes PVC with size and mode, control plane binds it to a matching PV.
  • Pod mount: pod references claim name in volumes, kubelet mounts the bound volume.
  • PersistentVolume: admin or provisioner created backing asset representing real disks or shares.
  • StorageClass: template for dynamic provisioning with provisioner and parameters.
  • Decoupling win: devs ask for storage without knowing cloud disk details.

Why D is correct

D is correct because Kubernetes requires pods to use a PersistentVolumeClaim to consume durable storage portably. The PVC abstracts provisioned PVs, handles binding and exposes the volume to containers via volumeMounts. Direct PV reference in pods bypasses claims and is not the standard attach path, StorageClass only defines how PVs are made, and StorageVolume is not a core resource. PVC is the documented pod-facing attachment object.

Why the others are wrong

  • A. StorageVolume is not a Kubernetes attach resource for pods.
  • B. PersistentVolume is the backing asset, pods claim it through PVCs rather than mounting it raw.
  • C. StorageClass drives provisioning, it does not itself mount into pod filesystems.

KCNA exam tip

Pod needs disk equals PVC. PV is the disk, class is the recipe, claim is the ticket.

5Which key-value store is used to persist Kubernetes cluster data?
  • etcd
  • ZooKeeper
  • ControlPlaneStore
  • Redis
Answer: A

The short version

A — etcd persists all cluster state as a key-value store. Deployments, config and status live there. Other stores are not the control-plane database.

Key concepts in this question

  • etcd traits: distributed, consistent Raft store with watchable keys and leases.
  • Control content: objects, revisions and leases that apiserver reads and writes.
  • ZooKeeper past: older orchestration used it, Kubernetes standardized on etcd.
  • Redis contrast: in-memory cache for apps, not the authoritative cluster ledger.
  • Fictional store: ControlPlaneStore is not a Kubernetes component.

Why A is correct

A is correct because kube-apiserver is stateless and delegates persistence to etcd. Every create, update and status change becomes versioned keys under lit prefixes, replicated for quorum and backup. Controllers watch etcd via apiserver to reconcile desired versus actual. ZooKeeper belongs to Hadoop era systems, Redis serves ephemeral caching, and no ControlPlaneStore exists. Vendor docs name etcd as the single source of cluster truth.

Why the others are wrong

  • B. ZooKeeper coordinates other distributed systems, not Kubernetes control state.
  • C. ControlPlaneStore is a distractor with no implementation in the platform.
  • D. Redis caches workloads, it does not provide Raft-backed cluster persistence.

KCNA exam tip

Cluster database equals etcd. Think Raft quorum plus apiserver statelessness.

6What Linux namespace is shared by default by containers running within a Kubernetes Pod?
  • Host Network
  • Network
  • Process ID
  • Process Name
Answer: B

The short version

B — Containers in a pod share the network namespace by default. One IP and port space serves all co-located containers. PID sharing is opt-in, host nets are explicit.

Key concepts in this question

  • Pod network: pause container holds shared stack that app containers join.
  • Localhost comms: sidecars reach each other via localhost with coordinated ports.
  • PID separation: processes stay isolated unless shareProcessNamespace is enabled.
  • Host network risk: hostNetwork true bypasses pod isolation and is off by default.
  • Design win: shared net plus separate filesystems balances cooperation and isolation.

Why B is correct

B is correct because Kubernetes assigns one IP per pod and joins all its containers to the same Linux network namespace. That lets a proxy sidecar intercept app traffic and lets helpers share sockets without service hops. Process ID namespaces remain separate unless explicitly shared, so Process ID is not default, Host Network requires privilege, and Process Name is not a namespace type. Vendor material states network sharing as the default pod contract.

Why the others are wrong

  • A. host Network attaches to node stack, only when explicitly requested for special agents.
  • C. Process ID sharing needs shareProcessNamespace true, it is not automatic.
  • D. Process Name is not a Linux namespace, it confuses naming with isolation primitive.

KCNA exam tip

Same pod equals same IP. Default share is network, PID share must be turned on.

7What is a Dockerfile?
  • A bash script that is used to automatically build a docker image.
  • A config file that defines which image registry a container should be pushed to.
  • A text file that contains all the commands a user could call on the command line to assemble an image.
  • An image layer created by a running container stored on the host.
Answer: C

The short version

C — Dockerfile is the build script text for an image. It lists base plus commands to assemble layers. It is not a registry pointer, bash runner or stored layer.

Key concepts in this question

  • Instruction set: FROM, RUN, COPY, CMD and ENTRYPOINT declare reproducible steps.
  • Layer build: each instruction creates cached filesystem diffs for fast rebuilds.
  • CLI link: docker build executes the file as if the user typed each command in order.
  • Registry contrast: push targets are flags and configs, not the Dockerfile role.
  • Layer contrast: built layers live in storage, the file is the recipe, not the cake.

Why C is correct

C is correct because the official definition calls a Dockerfile a text file with all commands a user could call to assemble an image. Builders parse it deterministically, cache intermediate layers and tag the final artifact for registries. It is versioned with code, linted and scanned. Calling it a bash script misses the builder semantics, registry config misses its purpose, and layer description confuses source with output.

Why the others are wrong

  • A. bash script analogy ignores Dockerfile syntax, caching and layer model.
  • B. registry destination is set at push or config time, not by the build file purpose.
  • D. layer from a running container describes committed state, not the declarative recipe.

KCNA exam tip

Dockerfile equals image recipe text. Registry equals where, layer equals built result.

8What does the "nodeSelector" within a PodSpec use to place Pods on the target nodes?
  • Annotations
  • IP Addresses
  • Hostnames
  • Labels
Answer: D

The short version

D — nodeSelector places pods using node labels. Simple key pairs on nodes steer matching pods. Annotations, IPs and hostnames are not the selector input.

Key concepts in this question

  • Label model: portable metadata like disk or zone attached to nodes.
  • Selector match: pod asks for label values, scheduler filters to labeled hosts.
  • Annotation use: non-selectable notes for tooling, ignored by scheduling.
  • Addressing contrast: IPs and hostnames identify machines but are not selector keys.
  • Affinity upgrade: complex rules build on the same label foundation.

Why D is correct

D is correct because PodSpec nodeSelector is a map of label keys to required values evaluated against node labels. A pod asking for fast storage lands only where that label exists. Annotations carry info without selection semantics, IPs change and are not scheduling keys, hostnames need explicit affinity constructs. Vendor docs define nodeSelector as label-based placement, making Labels the settled mechanism.

Why the others are wrong

  • A. annotations store tool data, scheduler does not match on them.
  • B. IP addresses are endpoints, not stable scheduling attributes.
  • C. hostnames need node affinity or direct nodeName, not plain selector.

KCNA exam tip

Selector equals labels. Annotations never schedule, IPs never select.

9What do Deployments and StatefulSets have in common?
  • They manage Pods that are based on an identical container spec.
  • They support the OnDelete update strategy.
  • They support an ordered, graceful deployment and scaling.
  • They maintain a sticky identity for each of their Pods.
Answer: A

The short version

A — Both manage pods from an identical container spec. Template-driven replicas give uniform images and config. Ordering, sticky identity and OnDelete belong mainly to StatefulSets.

Key concepts in this question

  • Pod template: shared container image, env and volumes stamped onto each replica.
  • Deployment focus: stateless scale plus rolling updates with interchangeable pods.
  • StatefulSet focus: stable network plus storage per ordinal, still from one template.
  • Ordered care: graceful sequence is a StatefulSet guarantee, not a Deployment promise.
  • Sticky trait: per-pod identity and storage persist only in StatefulSets.

Why A is correct

A is correct because Deployments and StatefulSets both create pods from a single identical container spec via their template field. That ensures consistency of runtime, probes and mounts across replicas. Differences appear in identity and update behavior: Deployments favor fungible rolling, StatefulSets favor ordered stable members. The commonality tested is template uniformity, which vendor prose confirms for both controllers.

Why the others are wrong

  • B. OnDelete is a StatefulSet update strategy, Deployments use RollingUpdate and Recreate.
  • C. ordered graceful rollout is the StatefulSet hallmark, Deployments do not guarantee ordinal order.
  • D. sticky identity with stable storage is exclusive to StatefulSets, not shared.

KCNA exam tip

Shared equals same template. Ordered, sticky and OnDelete equal StatefulSet only.

10What is the practice of bringing financial accountability to the variable spend model of cloud resources?
  • FaaS
  • DevOps
  • CloudCost
  • FinOps
Answer: D

The short version

D — FinOps brings financial accountability to variable cloud spend. It aligns engineering, finance and ops on cost-aware use. FaaS, DevOps and CloudCost miss that discipline.

Key concepts in this question

  • Variable model: pay for what runs creates elastic bills that need ownership.
  • FinOps loop: inform with allocation, optimize with rightsizing, operate with guardrails.
  • Collaboration: shared language for unit cost, forecasts and budgets across teams.
  • FaaS scope: a compute style, not a cost practice.
  • DevOps scope: delivery automation without explicit spend accountability.

Why D is correct

D is correct because FinOps is defined as the operating practice that makes variable cloud cost visible and accountable while preserving agility. Teams tag, forecast and set budgets, then tune architecture for value. FaaS describes functions, DevOps describes pipelines, CloudCost is a generic phrase, not the movement. Vendor material names FinOps as finance plus operations for cloud economics, matching the stem exactly.

Why the others are wrong

  • A. FaaS is serverless compute, it does not govern budgets or accountability.
  • B. DevOps speeds delivery, cost control is not its defining outcome.
  • C. CloudCost is descriptive, lacking the FinOps framework of people and process.

KCNA exam tip

Variable spend plus accountability equals FinOps. Compute or delivery terms are traps.

Want the full bank of 281 questions for Kubernetes and Cloud Native Associate (KCNA)? See all practice exams.