Kubernetes Container Orchestration Scheduling and Scaling 4 — Questions and Answers
Question 1: Which Cluster Autoscaler behavior causes it to scale down a node group even if pods on the node are not reschedulable?
- --skip-nodes-with-local-storage=false (Correct answer)
- --balance-similar-node-groups=true
- --scale-down-unneeded-time=0
- --expander=random
Correct answer: --skip-nodes-with-local-storage=false
By default, Cluster Autoscaler won't remove nodes with pods using local storage; setting this flag to false overrides that safety check.
Question 2: A pod spec has both `resources.requests.cpu: 500m` and `resources.limits.cpu: 500m`. What QoS class is assigned to this pod?
- BestEffort
- Burstable
- Guaranteed (Correct answer)
- Critical
Correct answer: Guaranteed
When requests equal limits for all containers and all resource types, Kubernetes assigns the Guaranteed QoS class.
Question 3: What is the purpose of the `--horizontal-pod-autoscaler-sync-period` flag on the kube-controller-manager?
- How often HPA fetches metrics and recalculates replica counts (Correct answer)
- The cooldown period after a scale-up event
- The time HPA waits before scaling down after scale-up
- The interval at which new pods become eligible for HPA management
Correct answer: How often HPA fetches metrics and recalculates replica counts
This flag (default 15s) controls how frequently the HPA controller queries metrics and evaluates whether to scale.
Question 4: You apply a taint `node.kubernetes.io/not-ready:NoExecute` to a node. What happens to already-running pods without a matching toleration?
- They continue running indefinitely
- They are immediately terminated
- They are evicted after the toleration seconds timeout (default 300s) (Correct answer)
- They are rescheduled to other nodes without eviction
Correct answer: They are evicted after the toleration seconds timeout (default 300s)
NoExecute taints evict existing pods; if no tolerationSeconds is specified, Kubernetes defaults to 300 seconds before eviction.
Question 5: Which field in a TopologySpreadConstraint controls how unbalanced pod distribution across topology zones is allowed?
- topologyKey
- labelSelector
- maxSkew (Correct answer)
- whenUnsatisfiable
Correct answer: maxSkew
maxSkew defines the maximum allowed difference in pod count between the most and least populated topology domains.
Question 6: In Kubernetes, what does the `descheduler` project do that the default scheduler cannot?
- Schedules pods faster using bin-packing algorithms
- Evicts and reschedules already-running pods to improve cluster balance (Correct answer)
- Prevents pods from being scheduled on overloaded nodes
- Integrates with external cloud autoscalers
Correct answer: Evicts and reschedules already-running pods to improve cluster balance
The descheduler continuously evaluates running pod placement and evicts pods that violate policies like balance or affinity rules that changed after scheduling.
Question 7: What does the `preferredDuringSchedulingIgnoredDuringExecution` node affinity rule do when no node satisfies the preference?
- The pod stays Pending until a matching node is available
- The pod is scheduled on any available node regardless of the preference (Correct answer)
- The pod is scheduled with reduced priority
- The scheduler throws a validation error
Correct answer: The pod is scheduled on any available node regardless of the preference
Preferred affinity rules are soft constraints; if no node satisfies them, the pod is still scheduled on the best available node.
Which Cluster Autoscaler behavior causes it to scale down a node group even if pods on the node are not reschedulable?