Bird
0
0

You want to run a logging agent on all Linux nodes but exclude Windows nodes in your Kubernetes cluster. How should you configure the DaemonSet?

hard📝 Best Practice Q15 of 15
Kubernetes - Scheduling
You want to run a logging agent on all Linux nodes but exclude Windows nodes in your Kubernetes cluster. How should you configure the DaemonSet?
AAdd a <code>nodeSelector</code> with <code>kubernetes.io/os: linux</code> in the pod spec
BAdd a <code>tolerations</code> for Windows taints in the pod spec
CSet the DaemonSet selector to <code>os: linux</code> label
DUse a Deployment instead of DaemonSet with node affinity
Step-by-Step Solution
Solution:
  1. Step 1: Identify how to target Linux nodes only

    Kubernetes labels nodes with kubernetes.io/os set to their OS. Using nodeSelector with kubernetes.io/os: linux restricts pods to Linux nodes.
  2. Step 2: Evaluate other options

    Tolerations are for taints, not OS filtering. Selector matches pod labels, not nodes. Deployment does not guarantee one pod per node.
  3. Final Answer:

    Add a nodeSelector with kubernetes.io/os: linux in the pod spec -> Option A
  4. Quick Check:

    Use nodeSelector to filter nodes by OS [OK]
Quick Trick: Use nodeSelector with OS label to filter nodes [OK]
Common Mistakes:
  • Using selector to filter nodes instead of nodeSelector
  • Confusing tolerations with node filtering
  • Using Deployment instead of DaemonSet for per-node pods

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes