Kubernetes · Orchestration under pressure
What is a DaemonSet used for?
Short answer
A DaemonSet runs one pod on every eligible node, or on a selected subset. It is used for node-level agents such as log collectors, metrics exporters, CNI components and storage drivers.
The DaemonSet controller creates a pod for each node that matches its node selector and tolerations. When a node joins, a pod is added; when it leaves, the pod is cleaned up. There is no replica count because the node set determines the count.
- Use nodeSelector or affinity to limit which nodes get the pod
- Add tolerations for control-plane taints if the agent must run there
- A DaemonSet pod often needs hostPath or hostNetwork access
- Resource requests matter because the agent consumes capacity on every node
- Rolling updates replace pods node by node according to maxUnavailable
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-exporter
spec:
selector:
matchLabels:
app: node-exporter
template:
metadata:
labels:
app: node-exporter
spec:
tolerations:
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule
containers:
- name: exporter
image: registry.example.com/node-exporter:1.8.1
resources:
requests:
cpu: 50m
memory: 64MiBecause DaemonSets touch every node, a bad rollout has cluster-wide blast radius. Stage changes on a small node pool, keep resource requests tight and verify that the agent tolerates node pressure rather than competing with application pods.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1How does a DaemonSet decide which nodes to target?
- 2Why would a DaemonSet need a toleration?
- 3What is the blast radius of a bad DaemonSet rollout?
- 4When would you use a Deployment instead of a DaemonSet?
Say it in the interview
A DaemonSet runs exactly one pod per eligible node, which makes it the right tool for node-level agents like log collectors or exporters. Node selectors and tolerations decide eligibility, and there is no replica count to manage. Because it touches every node, I roll it out cautiously and keep its resource requests small. If a pod is missing, I check taints and selectors first.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Kubernetes mock interview and get scored feedback on depth, clarity and confidence.