kubelet kubeadm 版本號不一致造成worker狀態一直爲NotReady

一、 問題

在對master、worker節點安裝kubelet kubeadm時剛好k8s的版本更新,之前的安裝是採用默認的安裝,爲指定版本號,造成worker節點加入到master節點時,node節點一直都是notReady狀態。

二、 安裝指定版本號

2.1 查看所以版本號

$ yum list kubelet kubeadm kubectl  --showduplicates|sort -r

已加載插件:fastestmirror
已安裝的軟件包
可安裝的軟件包
 * updates: mirrors.zju.edu.cn
Loading mirror speeds from cached hostfile
kubelet.x86_64                       1.16.0-0                        kubernetes 
kubelet.x86_64                       1.16.0-0                        @kubernetes
kubelet.x86_64                       1.15.4-0                        kubernetes 
kubelet.x86_64                       1.15.3-0                        kubernetes 
kubelet.x86_64                       1.15.2-0                        kubernetes 
kubelet.x86_64                       1.15.1-0                        kubernetes 
kubelet.x86_64                       1.15.0-0                        kubernetes 
...

2.2 安裝指定版本

$ yum install -y kubelet-1.15.3 kubeadm-1.15.3

2.3 查看版本

$ kubeadm version
--------------------------------------------------------------------------------------------
kubeadm version: &version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3**", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:11:18Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

$ kubectl version --client
--------------------------------------------------------------------------------------------
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

$ kubelet --version
-------------------------------------------------------------------------------------------
Kubernetes v1.15.3

2.4 設置kubectl啓動和開啓自啓

$ systemctl enable kubelet && systemctl start kubelet

三、 卸載

$ yum remove kubectl kubeadm

四、 node加入master節點

$ kubeadm join 192.168.25.131:6443 --token abcdef.0123456789abcdef \
    --discovery-token-ca-cert-hash sha256:711846bdc8459c5d6f72bbb62f44cab563faccf4c8cd87cf227483ee05986198

五、 查看狀態

[[email protected] kubeadm]# kubectl get nodes
NAME                    STATUS     ROLES    AGE   VERSION
localhost.localdomain   Ready      master   44m   v1.15.3
node01                  Ready      <none>   26s   v1.15.3
node02                  NotReady   <none>   25m   v1.16.0

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章