$kubectldrain--helpDrainnodeinpreparationformaintenance.Thegivennodewillbemarkedunschedulabletopreventnewpodsfromarriving.'drain'evictsthepodsiftheAPIServersupportseviction (http://kubernetes.io/docs/admin/disruptions/). Otherwise, it will use normal DELETE to delete thepods.The'drain'evictsordeletesallpodsexceptmirrorpods (which cannotbedeletedthroughtheAPIserver). IfthereareDaemonSet-managedpods,drainwillnotproceedwithout--ignore-daemonsets,andregardlessitwillnotdeleteanyDaemonSet-managedpods,becausethosepodswouldbeimmediatelyreplacedbytheDaemonSetcontroller,whichignoresunschedulablemarkings.IfthereareanypodsthatareneithermirrorpodsnormanagedbyReplicationController,ReplicaSet,DaemonSet,StatefulSetorJob,thendrainwillnotdeleteanypodsunlessyouuse--force.--forcewillalsoallowdeletiontoproceedifthemanagingresourceofoneormorepodsismissing.'drain'waitsforgracefultermination.Youshouldnotoperateonthemachineuntilthecommandcompletes.Whenyouarereadytoputthenodebackintoservice,usekubectluncordon,whichwillmakethenodeschedulableagain.!http://kubernetes.io/images/docs/kubectl_drain.svgExamples:# Drain node "foo", even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet orStatefulSetonit.$kubectldrainfoo--force# As above, but abort if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet orStatefulSet,anduseagraceperiodof15minutes.$kubectldrainfoo--grace-period=900Options: --delete-local-data=false:ContinueeveniftherearepodsusingemptyDir (local datathatwillbedeletedwhenthenodeisdrained). --dry-run=false:Iftrue,onlyprinttheobjectthatwouldbesent,withoutsendingit. --force=false:ContinueeveniftherearepodsnotmanagedbyaReplicationController,ReplicaSet,Job,DaemonSetorStatefulSet. --grace-period=-1:Periodoftimeinsecondsgiventoeachpodtoterminategracefully.Ifnegative,thedefaultvaluespecifiedinthepodwillbeused. --ignore-daemonsets=false:IgnoreDaemonSet-managedpods.-l,--selector='':Selector (label query) to filter on --timeout=0s:Thelengthoftimetowaitbeforegivingup,zeromeansinfiniteUsage:kubectldrainNODE [options]Use"kubectl options"foralistofglobalcommand-lineoptions (applies toallcommands).