$kubectldrainbjzw-prek8sredis-99-40node"bjzw-prek8sredis-99-40"alreadycordonederror:unabletodrainnode"bjzw-prek8sredis-99-40",abortingcommand...Therearependingnodestobedrained:bjzw-prek8sredis-99-40error: DaemonSet-managed pods (use --ignore-daemonsets to ignore): calicoopsmonitor-mfpqs, arachnia-agent-j56n8; pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (use --force to override): kube-proxy-bjzw-prek8sredis-99-40
$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).