Kubernetes 1.16.x升级后的问题有哪些

45次阅读
没有评论

共计 4025 个字符,预计需要花费 11 分钟才能阅读完成。

这篇文章主要讲解了“Kubernetes 1.16.x 升级后的问题有哪些”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着丸趣 TV 小编的思路慢慢深入,一起来研究和学习“Kubernetes 1.16.x 升级后的问题有哪些”吧!

1、主要变化

除了 apiserver/controller/scheduler 几个主要的服务的镜像版本变为 1.16.3 之外,其它包括:

etcd 使用的是 3.3.15-0(还不是最新的 4.x 系列)。

CoreDNS 使用的是 1.6.2(1.15.x 还是 1.3.1,变化比较大),这个会引起启动失败。

2、Docker 支持

Ubuntu 系统自动升级 Docker-CE 到了 19.3.4,但是使用 kubectl get node -owide 获取节点信息发现,始终是 Not Ready 状态。

查看状态:kubectl describe node/podc01,发现 CNI 失败。

将其降级到 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,变化比较大),这个会引起启动失败。

参见 https://github.com/Azure/aks-engine/pull/1493

主要原因是直接对 Docker Image 升级的话,配置参数没有同步升级。

但是老的参数对新的版本又不适用,这个就比较悲催了。

只能期待发布一个新的参数或升级工具,或者以后 CoreDNS 将跨版本的配置参数封装在镜像里。

目前这个问题还没有更好的解决方案,等待 CoreDNS 社区牛人出手。

4、Dashboard

Dashboard 1.x 只支持到 1.15,升级镜像到 1.10.1 版本也不行,而且不再维护、更新了。

Kubernetes 1.16.x 只能使用 Dashboard 2.x。

但是这个呢,目前还在开发中,最新的是 Beta5。

Dashboard 2.x 有几个大的变化:

这个对中国用户到是方便了,可以系统直接 pull 下来。

缺省的安装模版中 namespace 为 kubernetes-dashboard,不是 kube-system 了。

Docker image 位置变了,从 gcr 摘出来了,变为 kubernetesui/dashboard:v2.0.0-beta5。

安装指示安装完 Dashboard 2.x,登录到系统,信息显示不出来。

5、JupyterHub

原来的 JupuyterHub for K8s 运行得好好的,升级完后 Server 就启动不起来了。

进去查看信息:

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 都是可以的。

进一步检查 hub 的日志:

kubectl logs pod/hub-75d575499b-6d76n -n jupyter

得到下面的出错信息,是 JupyterHub 启动 Notebook Server 是执行脚本过程中出错:

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

目前,还没有找到好的解决办法,只能先放到项目的 issue 里,等着。

下面是一个临时的补丁方法(亲测可用):

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 升级后的问题有哪些”的内容了,经过本文的学习后,相信大家对 Kubernetes 1.16.x 升级后的问题有哪些这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是丸趣 TV,丸趣 TV 小编将为大家推送更多相关知识点的文章,欢迎关注!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-16发表,共计4025字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)