KCNA Container Orchestration 3 — Questions and Answers
Question 1: Which Kubernetes resource guarantees that a minimum number of Pods in a Deployment remain available during voluntary disruptions?
- ResourceQuota
- LimitRange
- PodDisruptionBudget (Correct answer)
- PriorityClass
Correct answer: PodDisruptionBudget
A PodDisruptionBudget (PDB) limits the number of Pods of a replicated application that are down simultaneously during voluntary disruptions.
Question 2: What is the effect of adding a taint `NoSchedule` to a node?
- Existing Pods are evicted from the node
- New Pods without a matching toleration will not be scheduled on the node (Correct answer)
- The node is removed from the cluster
- All Pods on the node are restarted
Correct answer: New Pods without a matching toleration will not be scheduled on the node
A `NoSchedule` taint prevents new Pods from being scheduled on the node unless they have a matching toleration.
Question 3: In a StatefulSet, how are Pods named?
- Randomly generated UUIDs
- Sequential ordinal names (e.g., pod-0, pod-1) (Correct answer)
- Based on node hostname
- Using the Deployment name plus a hash
Correct answer: Sequential ordinal names (e.g., pod-0, pod-1)
StatefulSet Pods receive stable, predictable names using an ordinal index appended to the StatefulSet name.
Question 4: Which Kubernetes object is best suited for running a batch job that should execute to completion exactly once?
- Deployment
- CronJob
- Job (Correct answer)
- DaemonSet
Correct answer: Job
A Job creates one or more Pods and ensures they successfully terminate, making it ideal for one-time batch tasks.
Question 5: What does the `imagePullPolicy: Always` setting do in a container spec?
- Caches the image locally and never re-pulls
- Pulls the image every time the container starts, even if locally cached (Correct answer)
- Only pulls the image if the tag changes
- Pulls the image once per node lifetime
Correct answer: Pulls the image every time the container starts, even if locally cached
With `Always`, Kubernetes pulls the container image from the registry on every Pod start, bypassing the local cache.
Question 6: Which probe type in Kubernetes checks whether a container is ready to serve traffic?
- livenessProbe
- startupProbe
- readinessProbe (Correct answer)
- healthProbe
Correct answer: readinessProbe
A readinessProbe determines if a container is ready to accept traffic; failing Pods are removed from Service endpoints.
Question 7: What is the function of an Init Container in a Pod?
- Runs alongside the main container to provide sidecar functionality
- Runs before app containers and must complete successfully before they start (Correct answer)
- Handles graceful shutdown of the main container
- Provides a default environment for all containers in the Pod
Correct answer: Runs before app containers and must complete successfully before they start
Init Containers run sequentially before app containers and must exit successfully; they are used for setup tasks.
Which Kubernetes resource guarantees that a minimum number of Pods in a Deployment remain available during voluntary disruptions?