Bird
0
0

After running kubectl drain node1, you receive an error stating pods managed by daemonsets are preventing eviction. What should you do to resolve this?

medium📝 Troubleshoot Q6 of 15
Kubernetes - Production Best Practices
After running kubectl drain node1, you receive an error stating pods managed by daemonsets are preventing eviction. What should you do to resolve this?
AAdd the <code>--ignore-daemonsets</code> flag to the drain command
BDelete the daemonset pods manually before draining
CRun <code>kubectl delete node node1</code> to remove the node
DRestart the kubelet service on node1
Step-by-Step Solution
Solution:
  1. Step 1: Understand daemonset pods behavior

    Daemonset pods are not evicted by default during drain to avoid disruption.
  2. Step 2: Use --ignore-daemonsets flag

    This flag tells kubectl drain to ignore daemonset-managed pods and proceed with eviction.
  3. Final Answer:

    Add --ignore-daemonsets to the drain command -> Option A
  4. Quick Check:

    Ignore daemonsets to allow drain [OK]
Quick Trick: Use --ignore-daemonsets flag to bypass daemonset pods [OK]
Common Mistakes:
  • Manually deleting daemonset pods which will be recreated
  • Deleting the node instead of draining
  • Restarting kubelet without addressing pod eviction

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes