您的位置:首页 > Web前端 > Node.js

k8s-11-删除node节点在加入

2018-10-09 17:04 861 查看
1.删除node节点不用key认证直接加入,加入原来的master这样没有通过key认证
master节点:
[root@k8s-master ~]# kubectl   get node 
NAME            STATUS    ROLES     AGE       VERSION
192.168.56.11   Ready     <none>    4m        v1.10.1
192.168.56.12   Ready     <none>    25d       v1.10.1
[root@k8s-master ~]# kubectl get csr 
No resources found.
[root@k8s-master ~]# kubectl  delete node  192.168.56.11
node "192.168.56.11" deleted
[root@k8s-master ~]# kubectl get csr 
No resources found.
[root@k8s-master ~]# kubectl   get node 
NAME            STATUS    ROLES     AGE       VERSION
192.168.56.12   Ready     <none>    25d       v1.10.1
[root@k8s-master ~]# 
node节点:
[root@k8s-node1 ssl]# systemctl  restart kubelet 
[root@k8s-node1 ssl]# 
master节点:
[root@k8s-master ~]# kubectl   get node 
NAME            STATUS     ROLES     AGE       VERSION
192.168.56.11   NotReady   <none>    5s        v1.10.1
192.168.56.12   Ready      <none>    25d       v1.10.1
[root@k8s-master ~]# kubectl   get node 
NAME            STATUS    ROLES     AGE       VERSION
192.168.56.11   Ready     <none>    33s       v1.10.1
192.168.56.12   Ready     <none>    25d       v1.10.1
[root@k8s-master ~]# 

2.node节点认证完毕 以后会在api-server 配置文件 --cert-dir=/opt/kubernetes/ssl  (master节点)  
的node的/opt/kubernetes/ssl路径下生成kubelet.crt  kubelet.key
2.1 master节点
kubectl delete node  192.168.56.11 

2.2node节点删除这两个文件
[root@k8s-node1 ssl]# mv kubelet.crt   kubelet.key   /tmp/
[root@k8s-node1 ssl]# mv  kubelet-client.crt  kubelet-client.key  /tmp/
[root@k8s-node1 ssl]# pwd
/opt/kubernetes/ssl
[root@k8s-node1 ssl]# systemctl restart kubelet
2.2master节点
[root@k8s-master ~]# kubectl  get node 
NAME            STATUS     ROLES     AGE       VERSION
192.168.56.11   NotReady   <none>    3m        v1.10.1
192.168.56.12   Ready      <none>    25d       v1.10.1
[root@k8s-master ~]# kubectl  get csr
NAME                                                   AGE       REQUESTOR           CONDITION
node-csr-nr9e8uosL2c7gOfmLthOXs5J8nrU1C3NWyt2iqZm_Ec   3m        kubelet-bootstrap   Pending
[root@k8s-master ~]# 
[root@k8s-master ~]# kubectl  certificate approve  node-csr-nr9e8uosL2c7gOfmLthOXs5J8nrU1C3NWyt2iqZm_Ec
certificatesigningrequest.certificates.k8s.io "node-csr-nr9e8uosL2c7gOfmLthOXs5J8nrU1C3NWyt2iqZm_Ec" approved
[root@k8s-master ~]# kubectl  get node 
NAME            STATUS     ROLES     AGE       VERSION
192.168.56.11   NotReady   <none>    4m        v1.10.1
192.168.56.12   Ready      <none>    25d    &
b60
nbsp;  v1.10.1
[root@k8s-master ~]# kubectl  get node 
NAME            STATUS    ROLES     AGE       VERSION
192.168.56.11   Ready     <none>    4m        v1.10.1
192.168.56.12   Ready     <none>    25d       v1.10.1
[root@k8s-master ~]#


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐