亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

k8s node節(jié)點重新加入master集群的實現(xiàn)

 更新時間:2021年02月22日 10:38:10   作者:Scarborought  
這篇文章主要介紹了k8s node節(jié)點重新加入master集群的實現(xiàn),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧

1、刪除node節(jié)點

執(zhí)行kubectl delete node node01

2、這時如果直接執(zhí)行加入,會報錯。如下:

[root@k8s-node02 pki]# kubeadm join 192.168.140.128:6443 --token abcdef.0123456789abcdef   --discovery-token-ca-cert-hash sha256:a3d9827be411208258aea7f3ee9aa396956c0a77c8b570503dd677aa3b6eb6d8 
[preflight] Running pre-flight checks
 [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.12. Latest validated version: 18.09
error execution phase preflight: [preflight] Some fatal errors occurred:
 [ERROR FileAvailable--etc-kubernetes-kubelet.conf]: /etc/kubernetes/kubelet.conf already exists
 [ERROR FileAvailable--etc-kubernetes-bootstrap-kubelet.conf]: /etc/kubernetes/bootstrap-kubelet.conf already exists
 [ERROR Port-10250]: Port 10250 is in use
 [ERROR FileAvailable--etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

 解決方案:

根據(jù)報錯可以看到端口被占用,配置文件可ca證書已經生成,所以需要刪除這些配置文件和證書,并且kill掉占用的端口。建議刪除之前先備份。

[root@k8s-node02 pki]# lsof -i:10250
COMMAND PID USER  FD  TYPE DEVICE SIZE/OFF NODE NAME
kubelet 694 root  30u IPv6 26021   0t0 TCP *:10250 (LISTEN)
[root@k8s-node02 pki]# kill -9 694
[root@k8s-node02 pki]# cd /etc/kubernetes/
[root@k8s-node02 kubernetes]# ls
bootstrap-kubelet.conf kubelet.conf manifests pki
[root@k8s-node02 kubernetes]# mv bootstrap-kubelet.conf bootstrap-kubelet.conf_bk
[root@k8s-node02 kubernetes]# mv kubelet.conf kubelet.conf_bk
[root@k8s-node02 kubernetes]# cd pki/
[root@k8s-node02 pki]# ls
ca.crt
[root@k8s-node02 pki]# rm -rf ca.crt 

3、再次執(zhí)行加入,又出現(xiàn)報錯。

[root@k8s-node02 ~]# kubeadm join 192.168.140.128:6443 --token abcdef.0123456789abcdef   --discovery-token-ca-cert-hash sha256:a3d9827be411208258aea7f3ee9aa396956c0a77c8b570503dd677aa3b6eb6d8 
[preflight] Running pre-flight checks
 [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.12. Latest validated version: 18.09
[preflight] 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.15" 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] Activating the kubelet service
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
[kubelet-check] Initial timeout of 40s passed.
error execution phase kubelet-start: error uploading crisocket: timed out waiting for the condition

解決方案:

執(zhí)行kubeadm reset子節(jié)點重置

[root@k8s-node02 ~]# 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
[preflight] Running pre-flight checks
W0710 10:22:57.487306  31093 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 /etc/cni/net.d /var/lib/dockershim /var/run/kubernetes]

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.
For example:
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X

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.

4、最后執(zhí)行加入,問題解決。

[root@k8s-node02 ~]# kubeadm join 192.168.140.128:6443 --token abcdef.0123456789abcdef   --discovery-token-ca-cert-hash sha256:a3d9827be411208258aea7f3ee9aa396956c0a77c8b570503dd677aa3b6eb6d8 
[preflight] Running pre-flight checks
 [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.12. Latest validated version: 18.09
[preflight] 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.15" 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] Activating the kubelet service
[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.

5、查看master節(jié)點,加入成功。

[root@k8s-master01 ~]# kubectl get nodes
NAME      STATUS  ROLES  AGE  VERSION
k8s-master01  Ready  master  120m  v1.15.1
k8s-node01   Ready  <none>  100m  v1.15.1
k8s-node02   Ready  <none>  83m  v1.15.1

到此這篇關于k8s node節(jié)點重新加入master集群的實現(xiàn)的文章就介紹到這了,更多相關k8s node master集群內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

  • Node.js處理HTTP請求的示例代碼

    Node.js處理HTTP請求的示例代碼

    Node.js是一個基于Chrome V8引擎的JavaScript運行環(huán)境,它使得JavaScript可以脫離瀏覽器在服務器端運行,Node.js的非阻塞I/O模型和事件驅動特性使其在處理HTTP請求時表現(xiàn)出色,本文將探討Node.js如何處理HTTP請求,并提供示例代碼,需要的朋友可以參考下
    2024-09-09
  • 一文搞懂npm?install?意義

    一文搞懂npm?install?意義

    我們在安裝依賴包的時候,不需要過多的去糾結是使用?-S?還是?-D?呢??隨便安裝到?dependencies?或者?devDependencies?里都行,反正?npm?install的時候,都會安裝dependencies?和?devDependencies依賴,今天通過本文學習npm?install意義,感興趣的朋友跟隨小編一起看看吧
    2022-12-12
  • Nodejs 構建Cluster集群多線程Worker threads

    Nodejs 構建Cluster集群多線程Worker threads

    這篇文章主要為大家介紹了Nodejs 構建Cluster集群多線程Worker threads示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-10-10
  • node.js中的console.warn方法使用說明

    node.js中的console.warn方法使用說明

    這篇文章主要介紹了node.js中的console.warn方法使用說明,本文介紹了console.warn的方法說明、語法、接收參數(shù)、使用實例和實現(xiàn)源碼,需要的朋友可以參考下
    2014-12-12
  • 初學者如何快速搭建Express開發(fā)系統(tǒng)步驟詳解

    初學者如何快速搭建Express開發(fā)系統(tǒng)步驟詳解

    這篇文章主要介紹了初學者如何快速搭建Express開發(fā)系統(tǒng),結合實例形式詳細分析了express框架搭建的具體步驟與相關注意事項,需要的朋友可以參考下
    2023-05-05
  • Node.js巧妙實現(xiàn)Web應用代碼熱更新

    Node.js巧妙實現(xiàn)Web應用代碼熱更新

    本文給大家講解的是Node.js的代碼熱更新的問題,其主要實現(xiàn)原理 是怎么對 module 對象做處理,也就是手工監(jiān)聽文件修改, 然后清楚模塊緩存, 重新掛載模塊,思路清晰考慮細致, 雖然有點冗余代碼,但還是推薦給大家
    2015-10-10
  • Mac下通過brew安裝指定版本的nodejs教程

    Mac下通過brew安裝指定版本的nodejs教程

    今天小編就為大家分享一篇Mac下通過brew安裝指定版本的nodejs教程,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-05-05
  • 如何自定義node版本,實現(xiàn)node多版本控制方式

    如何自定義node版本,實現(xiàn)node多版本控制方式

    這篇文章主要介紹了如何自定義node版本,實現(xiàn)node多版本控制方式,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-04-04
  • node.js中的fs.lstatSync方法使用說明

    node.js中的fs.lstatSync方法使用說明

    這篇文章主要介紹了node.js中的fs.lstatSync方法使用說明,本文介紹了fs.lstatSync的方法說明、語法、接收參數(shù)、使用實例和實現(xiàn)源碼,需要的朋友可以參考下
    2014-12-12
  • 基于Node.js的http模塊搭建HTTP服務器

    基于Node.js的http模塊搭建HTTP服務器

    這篇文章主要為大家介紹了基于Node.js的http模塊來搭建HTTP服務器的示例過程詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步
    2022-02-02

最新評論