Memory hook: Deployment repeats; StatefulSet identifies; DaemonSet covers nodes; Job finishes; CronJob schedules runs.
Must remember
| Workload | What it manages | Recognise this requirement |
|---|---|---|
| Deployment | ReplicaSets and replaceable Pods | Stateless services, rolling updates and replica count |
| StatefulSet | Pods with stable identities and ordered lifecycle features | Stable names and per-replica persistent storage |
| DaemonSet | A Pod on each eligible node | Node log collectors, network agents or monitoring agents |
| Job | Work that runs to completion | A batch calculation or one-off migration |
| CronJob | Jobs created on a schedule | Regular reports or scheduled maintenance work |
- A ReplicaSet maintains the requested replica count; a Deployment adds rollout management. A StatefulSet does not make database replication, backups or application consistency automatic.
- The scheduler filters and scores nodes against a Pod's requirements. Requests express resources needed for scheduling. Limits constrain runtime usage. For CPU,
500mis half a CPU; memory units such asMiandGiare binary quantities. - CPU over a limit is normally throttled. Exceeding available or permitted memory can lead to an out-of-memory kill. A large request can keep a Pod Pending even while actual node usage appears low.
- nodeSelector matches node labels. Node affinity supports richer required or preferred placement rules. Pod affinity/anti-affinity considers other Pods. Topology spread constraints help distribute replicas across failure domains.
- A taint discourages or prevents placement on a node. A matching toleration allows a Pod to tolerate that taint; it does not guarantee the Pod will be scheduled there. Other resource and placement checks still apply.
- Horizontal Pod Autoscaler, HPA, adjusts replica count from observed metrics. Vertical Pod Autoscaler, VPA, adjusts resource requests according to its configuration. Node autoscaling changes the available node capacity. None of these replaces a functioning application design.
- ResourceQuota limits aggregate resource use in a namespace. LimitRange can set per-object defaults and bounds. They do not grant permissions to users.
- Multiple replicas improve availability only when placement, capacity, readiness and dependent services support it. A PodDisruptionBudget limits certain voluntary disruptions; it does not prevent every hardware failure or guarantee recovery capacity.
Choose under exam pressure
| Requirement | Choice and reason |
|---|---|
| Run one node telemetry agent on every eligible node | DaemonSet |
| Add more web replicas when measured demand rises | HPA with a suitable metrics source |
| Add capacity because Pods cannot fit on existing nodes | Node autoscaling or capacity changes; more replicas alone cannot create node resources |
| Keep replicas away from a single failure domain | Suitable anti-affinity or topology spread configuration |
| Run a report every night and record completion | CronJob creating Jobs |
Traps
- A toleration removes a placement obstacle; it does not attract or reserve a node for the Pod.
- Requests influence scheduling even when current measured usage is low.
- A Deployment needs usable labels and selectors to manage the intended Pod set.
- Increasing replicas does not fix a broken image, incorrect configuration or an unavailable external database.
Active recall
1. A logging agent should run on every eligible worker. Deployment or DaemonSet?
DaemonSet. Its desired coverage follows eligible nodes, whereas a Deployment manages a requested number of replicas without inherently requiring one per node.
2. A Pod tolerates a GPU node's taint. Is it guaranteed to land on that node?
No. The toleration permits placement despite the taint. Resource availability, node selection, affinity and other scheduling constraints still decide eligibility and placement.
3. HPA adds replicas, but they remain Pending due to insufficient CPU. What scaling layer is missing?
Usable node capacity. Node autoscaling or another capacity adjustment may be needed. Also verify that requests and placement constraints are appropriate; HPA itself does not add nodes.
4. Which is more likely at a CPU limit: throttling or immediate termination purely for exceeding that limit?
CPU use is normally throttled. Memory is different: memory pressure or exceeding an enforced memory limit can lead to an out-of-memory kill.
5. A database needs stable replica names and separate persistent claims. What controller fits, and what does it not supply?
StatefulSet fits the identity and storage requirements. The database still needs correct replication, consistency, backup and recovery arrangements; the controller does not implement those application guarantees.