0
0
Kubernetesdevops~20 mins

DaemonSets for per-node workloads in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DaemonSet Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Output of DaemonSet Pod Distribution
You have a DaemonSet running on a Kubernetes cluster with 3 nodes. After running kubectl get pods -o wide, how many pods will you see for this DaemonSet?
A3 pods, one on each node
B1 pod, scheduled on the master node only
C0 pods, DaemonSets do not create pods automatically
D3 pods, but all scheduled on the same node
Attempts:
2 left
💡 Hint
DaemonSets ensure one pod per node unless node selectors or taints prevent scheduling.
🧠 Conceptual
intermediate
1:00remaining
Purpose of DaemonSets
What is the main purpose of using a DaemonSet in Kubernetes?
ATo run a copy of a pod on every node for node-level tasks
BTo manage multiple replicas of a pod for load balancing
CTo schedule pods only on master nodes
DTo create pods that run only once and then exit
Attempts:
2 left
💡 Hint
Think about tasks that need to run on all nodes, like monitoring or logging.
Troubleshoot
advanced
2:00remaining
DaemonSet Pods Not Running on New Nodes
You added two new nodes to your Kubernetes cluster, but the DaemonSet pods are not appearing on these new nodes. What is the most likely cause?
APods are scheduled only on nodes labeled as 'worker' and new nodes are labeled 'master'
BDaemonSets only schedule pods on nodes present at creation time
CThe DaemonSet controller needs to be restarted manually
DThe new nodes are tainted and the DaemonSet has no tolerations
Attempts:
2 left
💡 Hint
Check node taints and tolerations for DaemonSet pods.
Configuration
advanced
2:00remaining
DaemonSet Node Selector Configuration
You want your DaemonSet pods to run only on nodes labeled disk=ssd. Which snippet correctly configures this in the DaemonSet spec?
A"tolerations": [{"key": "disk", "value": "ssd"}]
B"nodeSelector": {"disk": "ssd"}
C"nodeSelector": {"ssd": "disk"}
D"affinity": {"nodeAffinity": {"requiredDuringSchedulingIgnoredDuringExecution": {"nodeSelectorTerms": [{"matchExpressions": [{"key": "disk", "operator": "In", "values": ["ssd"]}]}]}}}
Attempts:
2 left
💡 Hint
Node selectors use key-value pairs to filter nodes.
Best Practice
expert
2:30remaining
Best Practice for Updating DaemonSet Pods
You need to update the container image of a DaemonSet without downtime. Which strategy is best to achieve this?
ADelete the DaemonSet and recreate it with the new image
BManually delete pods one by one to force recreation with the new image
CUse the DaemonSet rolling update strategy with maxUnavailable set to 1
DUpdate the DaemonSet spec and immediately restart the kubelet on all nodes
Attempts:
2 left
💡 Hint
DaemonSets support rolling updates to minimize downtime.