温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2021-12-24 09:34:55 来源:亿速云 阅读:120 作者:iii 栏目:云计算

这篇文章主要讲解了“Kubernetes 1.16.x升级后的问题有哪些”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“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升级后的问题有哪些这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI