Kubernetes Container Orchestration Scheduling and Scaling 3 — Questions and Answers
Question 1: Which scheduler plugin phase is responsible for filtering out nodes that cannot run a pod?
- Score
- Filter (Correct answer)
- Bind
- Reserve
Correct answer: Filter
The Filter phase runs predicates (e.g., NodeResourcesFit, NodeAffinity) to eliminate nodes that are ineligible for the pod.
Question 2: You need pods of a Deployment to spread evenly across availability zones. Which spec field achieves this without writing custom affinity rules?
- spec.strategy.rollingUpdate.maxSurge
- spec.template.spec.topologySpreadConstraints (Correct answer)
- spec.template.spec.affinity.podAffinity
- spec.selector.matchLabels
Correct answer: spec.template.spec.topologySpreadConstraints
topologySpreadConstraints lets you declare a maxSkew and topology key (e.g., topology.kubernetes.io/zone) to spread pods evenly.
Question 3: What happens to a pod with `priorityClassName: low-priority` when a high-priority pod cannot be scheduled due to insufficient resources?
- The low-priority pod is evicted to free resources for the high-priority pod (Correct answer)
- The high-priority pod enters Pending state indefinitely
- The low-priority pod is rescheduled to a different node automatically
- Kubernetes scales up nodes before evicting low-priority pods
Correct answer: The low-priority pod is evicted to free resources for the high-priority pod
The scheduler's preemption logic evicts lower-priority pods to make room for higher-priority pods that cannot otherwise be scheduled.
Question 4: Which command shows the reason a pod is stuck in Pending state due to scheduling failure?
- kubectl logs <pod>
- kubectl describe pod <pod> (Correct answer)
- kubectl get events --all-namespaces
- kubectl top pod <pod>
Correct answer: kubectl describe pod <pod>
kubectl describe pod shows the Events section with FailedScheduling messages that explain why no node was selected.
Question 5: A KEDA ScaledObject targets a Kafka consumer group. What does KEDA use to determine the desired replica count?
- CPU utilization of existing consumer pods
- Consumer group lag (number of unprocessed messages) (Correct answer)
- The Kafka broker's memory usage
- Network throughput on the consumer pods
Correct answer: Consumer group lag (number of unprocessed messages)
KEDA scales based on event source metrics like consumer group lag, allowing it to scale to zero when there are no messages.
Question 6: What is the effect of setting `spec.nodeName` directly on a Pod spec?
- The pod will only schedule on nodes with that name as a label
- The pod bypasses the scheduler and is bound directly to the named node (Correct answer)
- The scheduler gives preference to the named node but may use others
- The pod fails to schedule if the named node is at capacity
Correct answer: The pod bypasses the scheduler and is bound directly to the named node
Setting spec.nodeName skips the scheduler entirely; the kubelet on the named node picks up the pod directly.
Question 7: When `minAvailable: 2` is set in a PodDisruptionBudget for a 3-replica deployment, how many pods can a node drain operation evict at once?
- 0
- 1 (Correct answer)
- 2
- 3
Correct answer: 1
With minAvailable: 2, at least 2 pods must remain available, so only 1 pod (3 - 2) can be disrupted at a time.
Which scheduler plugin phase is responsible for filtering out nodes that cannot run a pod?