How do you prevent a pod from being evicted during node maintenance?

  1. Use a PodDisruptionBudget (PDB) ✓
  2. Add a taint to the pod
  3. Increase pod resource requests
  4. Add nodeAffinity to the pod

Correct answer: Use a PodDisruptionBudget (PDB)

A PodDisruptionBudget (PDB) is the correct Kubernetes mechanism to protect pods during voluntary disruptions such as node drains for maintenance; it specifies the minimum number of pods that must remain available, causing the drain operation to wait rather than evict the protected pod. Option A is therefore correct. Option B is wrong because taints are applied to nodes, not pods, and they affect scheduling rather than eviction protection during maintenance. Option C is incorrect because increasing resource requests affects scheduling placement and quality-of-service class but does not prevent voluntary eviction triggered by a node drain. Option D is wrong because nodeAffinity controls which nodes a pod is scheduled onto, not whether it can be evicted once it is running.

Topic: · poddisruptionbudget, kubernetes, node maintenance, eviction

Practice Certified Kubernetes Administrator (CKA) Questions Free