Scheduling and Scaling 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 Scheduling and Scaling flashcards as text
Which `kubectl` command scales a Deployment named `web` to 10 replicas immediately?
Answer: kubectl scale deployment web --replicas=10
`kubectl scale` is the dedicated imperative command for adjusting the replica count of a Deployment, ReplicaSet, or StatefulSet.
What happens to pods on a node after `kubectl cordon ` is executed?
Answer: Existing pods continue running; no new pods will be scheduled on the node
`cordon` marks the node as unschedulable (SchedulingDisabled) but does not touch currently running pods.
Which metric server component must be installed for HPA to scale based on CPU and memory metrics?
Answer: metrics-server
HPA's built-in resource metrics (CPU/memory) rely on the `metrics-server` add-on, which aggregates resource usage from kubelets.
A pod spec sets `resources.requests.cpu: 500m`. What does this guarantee?
Answer: The scheduler will only place the pod on a node with at least 500 millicores of allocatable CPU available
CPU requests are used by the scheduler to find nodes with sufficient allocatable capacity; they do not cap actual usage.
What is the difference between `kubectl drain` and `kubectl cordon`?
Answer: drain cordons the node AND evicts all pods; cordon only prevents new scheduling
`drain` first cordons the node (marks it unschedulable) and then safely evicts all pods while respecting PodDisruptionBudgets.
Which pod scheduling feature ensures that two pods of the same application never land on the same node?
Answer: Pod anti-affinity with requiredDuringSchedulingIgnoredDuringExecution
Hard pod anti-affinity (`required...`) enforces that matching pods are never co-located on the same topology domain such as a node.
In the context of KEDA, what is a `ScaledObject`?
Answer: A custom resource that maps a Deployment to an event source and defines scaling parameters
A ScaledObject is a KEDA CRD that links a target workload (like a Deployment) to one or more event source scalers with min/max replica bounds.