共計(jì) 4025 個(gè)字符,預(yù)計(jì)需要花費(fèi) 11 分鐘才能閱讀完成。
這篇文章主要講解了“Kubernetes 1.16.x 升級(jí)后的問題有哪些”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著丸趣 TV 小編的思路慢慢深入,一起來研究和學(xué)習(xí)“Kubernetes 1.16.x 升級(jí)后的問題有哪些”吧!
1、主要變化
除了 apiserver/controller/scheduler 幾個(gè)主要的服務(wù)的鏡像版本變?yōu)?1.16.3 之外,其它包括:
etcd 使用的是 3.3.15-0(還不是最新的 4.x 系列)。
CoreDNS 使用的是 1.6.2(1.15.x 還是 1.3.1,變化比較大),這個(gè)會(huì)引起啟動(dòng)失敗。
2、Docker 支持
Ubuntu 系統(tǒng)自動(dòng)升級(jí) Docker-CE 到了 19.3.4,但是使用 kubectl get node -owide 獲取節(jié)點(diǎn)信息發(fā)現(xiàn),始終是 Not Ready 狀態(tài)。
查看狀態(tài):kubectl describe node/podc01,發(fā)現(xiàn) CNI 失敗。
將其降級(jí)到 19.3.2 后就可以了。
方法:
查看可用版本:sudo apt list docker-ce -a
安裝制定版本:sudo apt install docker-ce=xxxxxx
Update the /etc/docker/daemon.json
3、CoreDNS
CoreDNS 使用的是 1.6.2(1.15.x 還是 1.3.1,變化比較大),這個(gè)會(huì)引起啟動(dòng)失敗。
參見 https://github.com/Azure/aks-engine/pull/1493
主要原因是直接對(duì) Docker Image 升級(jí)的話,配置參數(shù)沒有同步升級(jí)。
但是老的參數(shù)對(duì)新的版本又不適用,這個(gè)就比較悲催了。
只能期待發(fā)布一個(gè)新的參數(shù)或升級(jí)工具,或者以后 CoreDNS 將跨版本的配置參數(shù)封裝在鏡像里。
目前這個(gè)問題還沒有更好的解決方案,等待 CoreDNS 社區(qū)牛人出手。
4、Dashboard
Dashboard 1.x 只支持到 1.15,升級(jí)鏡像到 1.10.1 版本也不行,而且不再維護(hù)、更新了。
Kubernetes 1.16.x 只能使用 Dashboard 2.x。
但是這個(gè)呢,目前還在開發(fā)中,最新的是 Beta5。
Dashboard 2.x 有幾個(gè)大的變化:
這個(gè)對(duì)中國(guó)用戶到是方便了,可以系統(tǒng)直接 pull 下來。
缺省的安裝模版中 namespace 為 kubernetes-dashboard,不是 kube-system 了。
Docker image 位置變了,從 gcr 摘出來了,變?yōu)?kubernetesui/dashboard:v2.0.0-beta5。
安裝指示安裝完 Dashboard 2.x,登錄到系統(tǒng),信息顯示不出來。
5、JupyterHub
原來的 JupuyterHub for K8s 運(yùn)行得好好的,升級(jí)完后 Server 就啟動(dòng)不起來了。
進(jìn)去查看信息:
supermap@podc01:~$ kubectl get pod -n jupyter -owide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
hub-75d575499b-6d76n 1/1 Running 0 19m 10.244.0.15 podc02 none none
proxy-589655677b-qcfrm 1/1 Running 0 19m 10.244.1.140 podc03 none none
kubectl logs hub-75d575499b-6d76n -n jupyter
hub 和 proxy 的 pod 和 svc 都是可以的。
進(jìn)一步檢查 hub 的日志:
kubectl logs pod/hub-75d575499b-6d76n -n jupyter
得到下面的出錯(cuò)信息,是 JupyterHub 啟動(dòng) Notebook Server 是執(zhí)行腳本過程中出錯(cuò):
E 2019-10-28 07:46:58.604 JupyterHub log:158] 500 GET /hub/user/supermap/ (supermap@10.244.7.0) 1028.54ms
[I 2019-10-28 07:47:18.636 JupyterHub log:158] 302 GET /hub/spawn - /user/supermap/ (supermap@10.244.7.0) 167.95ms
[I 2019-10-28 07:47:18.672 JupyterHub log:158] 302 GET /user/supermap/ - /hub/user/supermap/ (@10.244.7.0) 1.02ms
[E 2019-10-28 07:47:19.404 JupyterHub user:477] Unhandled error starting supermap s server: not supported between instances of datetime.datetime and NoneType
[E 2019-10-28 07:47:19.724 JupyterHub gen:974] Exception in Future Task finished coro= BaseHandler.spawn_single_user. locals .finish_user_spawn() done, defined at /usr/local/lib/python3.6/dist-packages/jupyterhub/handlers/base.py:619 exception=TypeError( not supported between instances of datetime.datetime and NoneType ,) after timeout
Traceback (most recent call last):
File /usr/local/lib/python3.6/dist-packages/tornado/gen.py , line 970, in error_callback
future.result()
File /usr/local/lib/python3.6/dist-packages/jupyterhub/handlers/base.py , line 626, in finish_user_spawn
await spawn_future
File /usr/local/lib/python3.6/dist-packages/jupyterhub/user.py , line 489, in spawn
raise e
File /usr/local/lib/python3.6/dist-packages/jupyterhub/user.py , line 409, in spawn
url = await gen.with_timeout(timedelta(seconds=spawner.start_timeout), f)
File /usr/local/lib/python3.6/dist-packages/kubespawner/spawner.py , line 1648, in _start
events = self.events
File /usr/local/lib/python3.6/dist-packages/kubespawner/spawner.py , line 1503, in events
for event in self.event_reflector.events:
File /usr/local/lib/python3.6/dist-packages/kubespawner/spawner.py , line 62, in events
key=lambda x: x.last_timestamp,
TypeError: not supported between instances of datetime.datetime and NoneType
目前,還沒有找到好的解決辦法,只能先放到項(xiàng)目的 issue 里,等著。
下面是一個(gè)臨時(shí)的補(bǔ)丁方法(親測(cè)可用):
kubectl patch deploy -n jupyter hub --type json --patch [{op : replace , path : /spec/template/spec/containers/0/command , value : [ bash , -c , \nmkdir -p ~/hotfix\ncp -r /usr/local/lib/python3.6/dist-packages/kubespawner ~/hotfix\nls -R ~/hotfix\npatch ~/hotfix/kubespawner/spawner.py EOT\n72c72\n key=lambda x: x.last_timestamp,\n---\n key=lambda x: x.last_timestamp and x.last_timestamp.timestamp() or 0.,\nEOT\n\nPYTHONPATH=$HOME/hotfix jupyterhub --config /srv/jupyterhub_config.py --upgrade-db\n ]}]
感謝各位的閱讀,以上就是“Kubernetes 1.16.x 升級(jí)后的問題有哪些”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì) Kubernetes 1.16.x 升級(jí)后的問題有哪些這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是丸趣 TV,丸趣 TV 小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!