java系统找不到指定文件怎么解决
250
2022-09-09
Kubernetes删除node节点再添加node节点
概述
我准备把zjj103节点从kubernetes集群踢出去,然后再加入进来
查看Node节点
[root@zjj101 ~]# kubectl get nodesNAME STATUS ROLES AGE VERSIONzjj101 Ready master 42h v1.18.0zjj102 Ready
删除节点
kubectl delete node [节点的名字]
[root@zjj101 ~]# kubectl delete node zjj103node "zjj103" deleted
再次查看有哪些节点
发现只有两个了
[root@zjj101 ~]# kubectl get nodesNAME STATUS ROLES AGE VERSIONzjj101 Ready master 42h v1.18.0zjj102 Ready
在node节点重置一下
kubeadm reset 命令
[root@zjj103 ~]# kubeadm reset[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
在Master节点获取token
在Master节点敲 kubeadm token create --print-join-command 然后回车,
观察控制台 ,会有输入语句,
[root@zjj101 ~]# kubeadm token create --print-join-commandW0228 13:55:13.351508 2655 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]kubeadm join 172.16.10.101:6443 --token 0ld7oi.jpecfi3dpxycy868 --discovery-token-ca-cert-hash sha256:13c8363f7beea0ee257730c981a501c222bc9a914c37331d07242149451f2f8f
这个就是token:
kubeadm join 172.16.10.101:6443 --token 0ld7oi.jpecfi3dpxycy868 --discovery-token-ca-cert-hash sha256:13c8363f7beea0ee257730c981a501c222bc9a914c37331d07242149451f2f8f
把这个token复制到你要加入node节点的机器上运行一下
在node节点输入token加入到kubernetes集群
[root@zjj103 ~]# kubeadm join 172.16.10.101:6443 --token 0ld7oi.jpecfi3dpxycy868 --discovery-token-ca-cert-hash sha256:13c8363f7beea0ee257730c981a501c222bc9a914c37331d07242149451f2f8fW0228 13:56:26.616118 72936 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.[preflight] Running pre-flight checks [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at Reading configuration from the cluster...[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.18" ConfigMap in the kube-system namespace[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.
在master节点查看node状态
[root@zjj101 ~]# kubectl get nodesNAME STATUS ROLES AGE VERSIONzjj101 Ready master 42h v1.18.0zjj102 Ready
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~