Flag --delete-local-data has been deprecated, This option is deprecated and will be deleted. Use --delete-emptydir-data.
node/node-1.for-best.cn cordoned
WARNING: ignoring DaemonSet-managed Pods: kube-system/kube-flannel-ds-rjx5q, kube-system/kube-proxy-z55bl
node/node-1.for-best.cn drained
[root@master-1 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master-1.for-best.cn Ready control-plane,master 23h v1.21.2
node-1.for-best.cn Ready,SchedulingDisabled <none> 22h v1.21.2
node-2.for-best.cn Ready <none> 22h v1.21.2
node-3.for-best.cn Ready <none> 22h v1.21.2
二、重置删除的节点(需要删除的节点上操作)
2.1 重置操作
kubeadm reset
2.2 操作输出查看,可忽略
[reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.
[reset] Are you sure you want to proceed? [y/N]: y
[preflight] Running pre-flight checks
W0709 16:32:03.731511 23599 removeetcdmember.go:79][reset] No kubeadm config, using etcd pod spec to get data directory
[reset] No etcd config found. Assuming external etcd
[reset] Please, manually reset etcd to prevent further issues
[reset] Stopping the kubelet service[reset] Unmounting mounted directories in"/var/lib/kubelet"[reset] Deleting contents of config directories: [/etc/kubernetes/manifests /etc/kubernetes/pki][reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf][reset] Deleting contents of stateful directories: [/var/lib/kubelet /var/lib/dockershim /var/run/kubernetes /var/lib/cni]
The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d
The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually by using the "iptables" command.
If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system's IPVS tables.
The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'[kubelet-start] Writing kubelet configuration to file"/var/lib/kubelet/config.yaml"[kubelet-start] Writing kubelet environment file with flags to file"/var/lib/kubelet/kubeadm-flags.env"[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.
Run 'kubectl get nodes' on the control-plane to see this node join the cluster.
[root@master-1 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master-1.for-best.cn Ready control-plane,master 23h v1.21.2
node-1.for-best.cn Ready <none> 17s v1.21.2
node-2.for-best.cn Ready <none> 22h v1.21.2
node-3.for-best.cn Ready <none> 22h v1.21.2
[root@master-1 ~]#