Pod Management & Scheduling Flashcards
7 cards from real KCNA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Pod Management & Scheduling flashcards as text
Which field in a Pod spec defines the list of init containers that run before app containers start?
Answer: initContainers
The `initContainers` field in the Pod spec lists containers that run to completion sequentially before any app containers start.
A Pod is in 'Pending' state for a long time. Which kubectl command best helps diagnose why it hasn't been scheduled?
Answer: kubectl describe pod
`kubectl describe pod` shows Events section with scheduler messages explaining why a pod cannot be placed.
What is the purpose of a PodDisruptionBudget (PDB)?
Answer: Limit voluntary disruptions by ensuring a minimum number of pods remain available
A PDB guarantees that a minimum number (or percentage) of pods stay available during voluntary disruptions like node drains.
Which scheduling feature allows you to spread pods evenly across failure domains like zones?
Answer: Topology Spread Constraints
Topology Spread Constraints use `topologyKey` to balance pod distribution across zones, nodes, or other topology domains.
In a multi-container Pod, how do containers share the network namespace by default?
Answer: All containers in a Pod share the same network namespace and IP
All containers within a Pod share one network namespace, meaning they share the same IP and can reach each other via localhost.
Which Pod restart policy causes a container to restart only if it exits with a non-zero exit code?
Answer: OnFailure
`restartPolicy: OnFailure` restarts the container only on non-zero exit codes, not on successful exits.
What does setting `terminationGracePeriodSeconds: 0` on a Pod do?
Answer: Forces immediate SIGKILL without waiting for graceful shutdown
Setting `terminationGracePeriodSeconds` to 0 bypasses the graceful shutdown window and sends SIGKILL immediately.