KCNA Scheduling and Scaling 4 — Questions and Answers
Question 1: What is the effect of setting `preemptionPolicy: Never` on a PriorityClass?
- Pods with this class will not preempt lower-priority pods even if resources are unavailable (Correct answer)
- Pods with this class cannot be preempted by higher-priority pods
- The scheduler ignores priority and schedules pods in FIFO order
- Pods are immediately evicted when resources are tight
Correct answer: Pods with this class will not preempt lower-priority pods even if resources are unavailable
`preemptionPolicy: Never` prevents pods in this PriorityClass from evicting lower-priority pods, though they are still queued ahead of them.
Question 2: A DaemonSet pod is running on every node. What happens when a new node joins the cluster?
- The DaemonSet controller automatically schedules a pod on the new node (Correct answer)
- A cluster admin must manually trigger pod creation on the new node
- The scheduler creates a pod on the new node during the next scheduling cycle
- A pod is created only if the new node matches the DaemonSet's nodeSelector
Correct answer: The DaemonSet controller automatically schedules a pod on the new node
The DaemonSet controller watches for new nodes and automatically creates a pod on each one that matches its selector (or all nodes if no selector is set).
Question 3: Which resource in Kubernetes allows you to set default CPU and memory requests/limits for containers that don't specify them?
- LimitRange (Correct answer)
- ResourceQuota
- PodTemplate
- HorizontalPodAutoscaler
Correct answer: LimitRange
A LimitRange can define default and maximum resource constraints that are applied to containers in a namespace when none are specified.
Question 4: What does the `maxSurge` field control in a Deployment's rolling update strategy?
- The maximum number of extra pods that can exist above the desired replica count during an update (Correct answer)
- The maximum number of pods that can be unavailable during an update
- The rate at which new ReplicaSets are created
- The maximum CPU surge allowed per pod during the update
Correct answer: The maximum number of extra pods that can exist above the desired replica count during an update
`maxSurge` limits how many additional pods can be created beyond the desired count during a rolling update, controlling update speed.
Question 5: Which condition must be true for the Cluster Autoscaler to add a new node?
- A pod is Pending because no existing node has sufficient resources to schedule it (Correct answer)
- CPU utilization across all nodes exceeds 80% for more than 5 minutes
- An HPA has requested more replicas than currently exist
- A node has been cordoned by an administrator
Correct answer: A pod is Pending because no existing node has sufficient resources to schedule it
Cluster Autoscaler triggers scale-up specifically when pods are stuck in Pending state due to insufficient resources on existing nodes.
Question 6: In a StatefulSet, pods are scheduled with what naming convention?
- <statefulset-name>-<ordinal-index> (Correct answer)
- <statefulset-name>-<random-hash>
- <namespace>-<statefulset-name>-<uuid>
- <statefulset-name>-pod-<ordinal-index>
Correct answer: <statefulset-name>-<ordinal-index>
StatefulSet pods are named with a stable, predictable pattern of `<name>-0`, `<name>-1`, etc., providing identity that persists across rescheduling.
Question 7: What is the role of `kube-scheduler` in the Kubernetes control plane?
- Watches for unbound pods and assigns them to nodes based on resource availability and constraints (Correct answer)
- Manages the lifecycle of all pods and reconciles desired vs actual state
- Stores the cluster state and serves as the source of truth for all objects
- Monitors node health and evicts pods from unhealthy nodes
Correct answer: Watches for unbound pods and assigns them to nodes based on resource availability and constraints
kube-scheduler's sole responsibility is to watch for unscheduled pods and select the best node for each based on filtering and scoring.
What is the effect of setting `preemptionPolicy: Never` on a PriorityClass?