[cloud-user@rext03-0141 project]$ kubectl cordon intnode04
node/intnode04 cordoned
[cloud-user@rext03-0141 project]$ kubectl drain intnode04 --ignore-daemonsets --delete-local-data
Flag --delete-local-data has been deprecated, This option is deprecated and will be deleted. Use --delete-emptydir-data.
node/intnode04 already cordoned
WARNING: ignoring DaemonSet-managed Pods: kube-system/canal-7kxlr, v4mlog/v4m-fb-nxh2s, v4mmon/v4m-node-exporter-m44hb
evicting pod kube-system/calico-kube-controllers-6c977d77bc-44r9s
pod/calico-kube-controllers-6c977d77bc-44r9s evicted
node/intnode04 evicted
[cloud-user@rext03-0141 project]$ kubectl get pods -A -o wide | grep intnode04
kube-system calico-kube-controllers-6c977d77bc-hqfcb 1/1 Running 0 53s 10.42.4.173 intnode04 <none> <none>
kube-system canal-7kxlr 2/2 Running 0 17d 192.168.6.4 intnode04 <none> <none>
v4mlog v4m-fb-nxh2s 1/1 Running 0 17d 10.42.4.6 intnode04 <none> <none>
v4mmon v4m-node-exporter-m44hb 1/1 Running 0 17d 192.168.6.4 intnode04 <none> <none>
Command 'kubectl drain intnode04 --ignore-daemonsets --delete-local-data' didn't work.
[cloud-user@rext03-0141 project]$ kubectl drain intnode04 --ignore-daemonsets --delete-emptydir-data
node/intnode04 already cordoned
WARNING: ignoring DaemonSet-managed Pods: kube-system/canal-7kxlr, v4mlog/v4m-fb-nxh2s, v4mmon/v4m-node-exporter-m44hb
evicting pod kube-system/calico-kube-controllers-6c977d77bc-hqfcb
pod/calico-kube-controllers-6c977d77bc-hqfcb evicted
node/intnode04 evicted
[cloud-user@rext03-0141 project]$ kubectl get nodes -A -o wide | grep intnode04
intnode04 Ready,SchedulingDisabled worker 17d v1.21.12 192.168.6.4 <none> CentOS Linux 7 (Core) 3.10.0-1062.12.1.el7.x86_64 docker://20.10.12
Command 'kubectl drain intnode04 --ignore-daemonsets --delete-emptydir-data' worked.
[cloud-user@rext03-0141 project]$ kubectl uncordon intnode04
node/intnode04 uncordoned
[cloud-user@rext03-0141 project]$ kubectl get nodes -A -o wide | grep intnode04
intnode04 Ready worker 17d v1.21.12 192.168.6.4 <none> CentOS Linux 7 (Core) 3.10.0-1062.12.1.el7.x86_64 docker://20.10.12