k8s集群中,有时候发现有些节点状态为 NotReady,如何修复为Ready状态呢?
[root@k8s-master~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION k8s-master Ready master 4d8h v1.14.1 k8s-node1 NotReady <none> 4d8h v1.14.1 k8s-node2 Ready <none> 4d8h v1.14.1
$ kubeadm token create
c9afga.w3fue0yh3gzxczic
查看token
$ kubeadm token list
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS c9afga.w3fue0yh3gzxczic 23h 2019-07-26T14:30:54+08:00 authentication,signing <none> system:bootstrappers:kubeadm:default-node-token
$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
8b79b6461e58c07333cb2851fe74fd4374af8bbbe0bf7e040b415b86ad4fb89d
$ kubeadm reset
$ kubeadm join 192.168.38.11:6443 --token c9afga.w3fue0yh3gzxczic \
--discovery-token-ca-cert-hash sha256:8b79b6461e58c07333cb2851fe74fd4374af8bbbe0bf7e040b415b86ad4fb89d
[root@k8s-master~]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready master 4d8h v1.14.1 k8s-node1 Ready <none> 4d8h v1.14.1 k8s-node2 Ready <none> 4d8h v1.14.1
所有评论(0)