资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Kubernetes1.16.x升级后的问题有哪些

这篇文章主要讲解了“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              
proxy-589655677b-qcfrm   1/1     Running   0          19m   10.244.1.140   podc03              

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 .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升级后的问题有哪些这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是创新互联,小编将为大家推送更多相关知识点的文章,欢迎关注!


网站标题:Kubernetes1.16.x升级后的问题有哪些
URL标题:http://cdkjz.cn/article/jgsspi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220