设置节点不可用
    重新调度该节点上所有的pod

    1. [rancher@rmaster01 ~]$ kubectl get nodes
    2. NAME STATUS ROLES AGE VERSION
    3. node01 Ready worker 23d v1.19.8
    4. node02 Ready worker 23d v1.19.8
    5. rmaster01 Ready controlplane,etcd 23d v1.19.8
    6. rmaster02 Ready controlplane,etcd 23d v1.19.8
    7. rmaster03 Ready controlplane,etcd 23d v1.19.8
    8. [rancher@rmaster01 ~]$ kubectl cordon rmaster01
    9. node/rmaster01 cordoned
    10. [rancher@rmaster01 ~]$ kubectl get nodes
    11. NAME STATUS ROLES AGE VERSION
    12. node01 Ready worker 23d v1.19.8
    13. node02 Ready worker 23d v1.19.8
    14. rmaster01 Ready,SchedulingDisabled controlplane,etcd 23d v1.19.8
    15. rmaster02 Ready controlplane,etcd 23d v1.19.8
    16. rmaster03 Ready controlplane,etcd 23d v1.19.8
    17. [rancher@rmaster01 ~]$ kubectl drain rmaster01 --ignore-daemonsets --delete-local-data --force
    18. node/rmaster01 already cordoned
    19. WARNING: ignoring DaemonSet-managed Pods: cattle-prometheus/exporter-node-cluster-monitoring-msmqz, cattle-system/cattle-node-agent-8rdtr, kube-system/canal-wczbn
    20. evicting pod kube-system/rke-network-plugin-deploy-job-tpt48
    21. evicting pod kube-system/rke-coredns-addon-deploy-job-snjhp
    22. evicting pod kube-system/rke-ingress-controller-deploy-job-2fvsw
    23. evicting pod kube-system/rke-metrics-addon-deploy-job-8drtr
    24. pod/rke-metrics-addon-deploy-job-8drtr evicted
    25. pod/rke-ingress-controller-deploy-job-2fvsw evicted
    26. pod/rke-coredns-addon-deploy-job-snjhp evicted
    27. pod/rke-network-plugin-deploy-job-tpt48 evicted
    28. node/rmaster01 evicted

    f86ae00a360fd08efd9653ef29aad9e.png