An administrator needs to drain a worker node safely for hardware maintenance, but some pods have local emptyDir storage that would be permanently deleted. Which flag must be added to the drain command to allow eviction of these pods?
Without this flag, kubectl drain aborts on pods using emptyDir volumes, since eviction destroys their local data. Adding --delete-emptydir-data acknowledges that loss and permits eviction, satisfying the maintenance requirement while leaving other pods safely rescheduled.
Why this answer
The --delete-emptydir-data flag explicitly tells kubectl/oc drain that it is acceptable to evict pods that use emptyDir volumes, which are node-local and will be permanently lost. Without this flag, drain refuses to proceed and reports an error listing pods with local storage. This is the documented way to acknowledge and accept the data loss during maintenance.
Exam trap
EX280 often tests the exact flag name for draining nodes with local storage, and candidates confuse it with non-existent flags like --allow-local-volumes or --force-local-storage.
How to eliminate wrong answers
Option A is wrong because --allow-local-volumes is not a valid drain flag; it does not exist in kubectl or oc. Option B is wrong because --ignore-daemonsets is a boolean flag (used to skip DaemonSet pods) and setting it to false does not permit eviction of pods with emptyDir storage. Option D is wrong because --force-local-storage is not a real drain option; the correct flag is --delete-emptydir-data.