Kubernetes1.20.4跨版本升級(jí)有哪些問題

這篇文章主要介紹“Kubernetes1.20.4跨版本升級(jí)有哪些問題”,在日常操作中,相信很多人在Kubernetes1.20.4跨版本升級(jí)有哪些問題問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對(duì)大家解答”Kubernetes1.20.4跨版本升級(jí)有哪些問題”的疑惑有所幫助!接下來,請(qǐng)跟著小編一起來學(xué)習(xí)吧!

成都創(chuàng)新互聯(lián)服務(wù)項(xiàng)目包括衛(wèi)輝網(wǎng)站建設(shè)、衛(wèi)輝網(wǎng)站制作、衛(wèi)輝網(wǎng)頁制作以及衛(wèi)輝網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,衛(wèi)輝網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到衛(wèi)輝省份的部分城市,未來相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!

Kubernetes 1.20.4已經(jīng)發(fā)布,一個(gè)集群從1.20.2順利升級(jí),但另外一個(gè)集群以前版本有點(diǎn)老,進(jìn)行跨版本升級(jí)時(shí)出現(xiàn)問題,后來全部重做,新安裝時(shí)也出現(xiàn)問題,無法kubeadm init和kubeadm join,后來終于搞好了,一些過程記錄如下:

證書問題

出現(xiàn)下面的情況:

(base) supermap@podc01:/etc$ sudo kubeadm join 10.1.1.202:6443 --token 4q3hdy.y7xjfjh0u1vqdx7k     --discovery-token-ca-cert-hash sha256:7eff3c734585308e0934c4af34a67edff0a98c5a3d9e99c24f1c5cdd09d3f519     --control-plane
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
error execution phase preflight: 
One or more conditions for hosting a new control plane instance is not satisfied.

failure loading certificate for CA: couldn't load the certificate file /etc/kubernetes/pki/ca.crt: open /etc/kubernetes/pki/ca.crt: no such file or directory

Please ensure that:
* The cluster has a stable controlPlaneEndpoint address.
* The certificates that must be shared among control plane instances are provided.


To see the stack trace of this error execute with --v=5 or higher

后來發(fā)現(xiàn)是kubeadm init時(shí)少寫了--upload-certs參數(shù)。加上后就不出現(xiàn)上面的錯(cuò)誤信息了。

有人用這個(gè)方法解決,我沒試過,感覺不行:

194  scp -rp /etc/kubernetes/pki/ca.* master02:/etc/kubernetes/pki
195  scp -rp /etc/kubernetes/pki/sa.* master02:/etc/kubernetes/pki
196  scp -rp /etc/kubernetes/pki/front-proxy-ca.* master02:/etc/kubernetes/pki
197  scp -rp /etc/kubernetes/pki/etcd/ca.* master02:/etc/kubernetes/pki/etcd
198  scp -rp /etc/kubernetes/admin.conf master02:/etc/kubernetes

master節(jié)點(diǎn)設(shè)置

把master node設(shè)為可以安裝其它負(fù)載。如下:

kubectl taint nodes --all node-role.kubernetes.io/master-

CoreDNS問題

CoreDNS 出現(xiàn)問題,pod啟動(dòng)失敗,如下:

supermap@podc02:~$ kubectl get pod -n kube-system
NAME                             READY   STATUS              RESTARTS   AGE
coredns-74ff55c5b-dtwdz          0/1     ContainerCreating   0          32m
coredns-74ff55c5b-jns5b          0/1     ContainerCreating   0          32m
etcd-podc02                      1/1     Running             0          32m
kube-apiserver-podc02            1/1     Running             0          32m
kube-controller-manager-podc02   1/1     Running             0          32m
kube-proxy-45jxl                 1/1     Running             0          32m
kube-scheduler-podc02            1/1     Running             0          32m

??這個(gè)后來發(fā)現(xiàn)是網(wǎng)絡(luò)驅(qū)動(dòng)問題,重新安裝flannel就可以了。

flannel安裝

flannel的項(xiàng)目已經(jīng)移到了flannel-io,原來的地址和raw.githubxxxx都訪問不了,需要到新地址下載。

wget https://github.com/flannel-io/flannel/releases/download/v0.13.0/flannel-v0.13.0-linux-amd64.tar.gz

上面這個(gè)是可以的,也許換個(gè)網(wǎng)絡(luò)又不行了。

訪問github時(shí)不通,總是出現(xiàn)下面的錯(cuò)誤。

fatal: 無法訪問 'https://github.com/openthings/kubernetes-tools.git/':gnutls_handshake() failed: Error in the pull function.

后來莫名其妙的又好了。

有人說要安裝這些軟件,裝了沒用。

supermap@pods01:~/openthings$ sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev

??更多的方法見后面。

systemd兼容性

用的docker 19.03,好久沒有升級(jí)了。但是Ubuntu和systemd都在升級(jí)。

總是出現(xiàn)kubeadm init失敗,把 /etc/docker/daemon.json 的systemd注釋掉就成功了。

kubernetes不是推薦cgroupfs用systemd的么?也不知道是咋回事,下次把docker升級(jí)一下,再試試。

sudo kubeadm join 10.1.1.201:6443 --token k4l26p.d99xrvu2higwz9ow     --discovery-token-ca-cert-hash sha256:eda3e649672134c93d11bdb741672b3add5073eb3f4da021274dc51f9278d5f1      --control-plane --certificate-key 0a3656c05b225b35724851d08a52ab5ba8c0b70ea64fd4beeb5d727225b63ce4

如果token過期了,可以用下面的命令重新生成:

sudo kubeadm init phase upload-certs --upload-certs

CNI問題

出現(xiàn)下面的CNI錯(cuò)誤信息:

3月 18 17:57:27 podc01 kubelet[312941]: E0318 17:57:27.777448  312941 kubelet.go:2184] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network pl>
3月 18 17:57:32 podc01 kubelet[312941]: W0318 17:57:32.184598  312941 cni.go:239] Unable to update cni config: no networks found in /etc/cni/net.d

用料哼多方法都搞不定,從別的機(jī)器上拷貝10-flannel.conflist過來:

sudo scp supermap@10.1.1.201:~/10-flannel.conflist /etc/cni/net.d/

文件中就這些內(nèi)容:

{
  "name": "cbr0",
  "cniVersion": "0.3.1",
  "plugins": [
    {
      "type": "flannel",
      "delegate": {
        "hairpinMode": true,
        "isDefaultGateway": true
      }
    },
    {
      "type": "portmap",
      "capabilities": {
        "portMappings": true
      }
    }
  ]
}

GnuTLS錯(cuò)誤

網(wǎng)上搜到的方法,還沒有試過:

Got reason of the problem, it was gnutls package. It's working weird behind a proxy. But openssl is working fine even in weak network. So workaround is that we should compile git with openssl. To do this, run the following commands:

sudo apt-get update
sudo apt-get install build-essential fakeroot dpkg-dev
sudo apt-get build-dep git
mkdir ~/git-openssl
cd ~/git-openssl
apt-get source git
dpkg-source -x git_1.7.9.5-1.dsc
cd git-1.7.9.5

(Remember to replace 1.7.9.5 with the actual version of git in your system.)

Then, edit debian/control file (run the command: gksu gedit debian/control) and replace all instances of libcurl4-gnutls-dev with libcurl4-openssl-dev.

Then build the package (if it's failing on test, you can remove the line TEST=test from the file debian/rules):

sudo apt-get install libcurl4-openssl-dev
sudo dpkg-buildpackage -rfakeroot -b

Install new package:

i386: sudo dpkg -i ../git_1.7.9.5-1_i386.deb

x86_64: sudo dpkg -i ../git_1.7.9.5-1_amd64.deb

Github訪問故障

在系統(tǒng)中找到 hosts 文件:

Window:C:\Windows\System32\drivers\etc\hosts 或r Linux:/etc/hosts

放入以下兩個(gè) IP 地址:

# GitHub Start 
140.82.114.4 github.com
199.232.69.194 github.global.ssl.fastly.net
# GitHub End

存盤退出。

在 CMD 命令行中執(zhí)行 ipconfig/flushdns,之后就能進(jìn)入Github 網(wǎng)址。

訪問這個(gè)地址 https://github.com.ipaddress.com/www.github.com 能夠查到github的ip地址信息。

集群配置情況

最后還是把集群給恢復(fù)起來了:

(base) supermap@podc01:~$ kubectl get node -owide
NAME     STATUS   ROLES                  AGE     VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION     CONTAINER-RUNTIME
podc01   Ready    control-plane,master   16h     v1.20.4   10.1.1.201    <none>        Ubuntu 20.10         5.8.0-45-generic   docker://20.10.5
podc02   Ready    control-plane,master   16h     v1.20.4   10.1.1.202    <none>        Ubuntu 20.04.2 LTS   5.4.0-67-generic   docker://19.3.8
podc04   Ready    control-plane,master   16h     v1.20.4   10.1.1.204    <none>        Ubuntu 20.04.2 LTS   5.4.0-67-generic   docker://19.3.8
pods01   Ready    control-plane,master   16h     v1.20.4   10.1.1.193    <none>        Ubuntu 20.04.2 LTS   5.4.0-67-generic   docker://19.3.8
pods02   Ready    control-plane,master   131m    v1.20.4   10.1.1.234    <none>        Ubuntu 20.04.2 LTS   5.4.0-67-generic   docker://19.3.8
pods03   Ready    control-plane,master   68m     v1.20.4   10.1.1.205    <none>        Ubuntu 20.04.2 LTS   5.4.0-67-generic   docker://19.3.8
pods04   Ready    control-plane,master   50m     v1.20.4   10.1.1.206    <none>        Ubuntu 20.04.2 LTS   5.4.0-67-generic   docker://19.3.8
pods05   Ready    control-plane,master   36m     v1.20.4   10.1.1.34     <none>        Ubuntu 20.04.2 LTS   5.4.0-66-generic   docker://19.3.8
pods06   Ready    control-plane,master   6m22s   v1.20.4   10.1.1.167    <none>        Ubuntu 20.04.2 LTS   5.4.0-66-generic   docker://19.3.8

三個(gè)節(jié)點(diǎn)出現(xiàn)其他異常:

  • 其中一個(gè)節(jié)點(diǎn)重啟多次后能夠正常更新;

  • 另一個(gè)節(jié)點(diǎn)podc03重啟多次都不行估計(jì)掛了;

  • 還有一個(gè)節(jié)點(diǎn)出現(xiàn)文件系統(tǒng)只讀,無法更新,后來修復(fù)了。

    • 啟動(dòng)時(shí)進(jìn)菜單,選擇修復(fù)。

    • 運(yùn)行fsck,然后重啟。

到此,關(guān)于“Kubernetes1.20.4跨版本升級(jí)有哪些問題”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

網(wǎng)站題目:Kubernetes1.20.4跨版本升級(jí)有哪些問題
URL地址:http://bm7419.com/article24/jdegce.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)、云服務(wù)器網(wǎng)站設(shè)計(jì)公司、外貿(mào)建站、商城網(wǎng)站微信小程序

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計(jì)