Kubernetes v1.8.12无法列出*扩展名.部署 [英] Kubernetes v1.8.12 can't list *extensions.Deployment

查看:417
本文介绍了Kubernetes v1.8.12无法列出*扩展名.部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有人

最近,我将k8s集群升级到v1.10.3,然后将其回滚到v1.9.8,然后又回滚到v1.8.12.之后,我发现了一些我听不懂的东西.

Recently I upgraded my k8s cluster to v1.10.3, then I rolled it back to v1.9.8, then to v1.8.12. After that I found something I can't understand.

我可以在默认名称空间中列出部署:

I can list deployment in my default namespace:

NAME                          DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
dunking-hedgehog-helmet       1         1         1            1           197d
kube-system-tomcat-official   1         1         1            1           197d
mongodb                       1         1         1            1           152d
smelly-pig-mysql              1         1         1            1           204d

但是不能在我的kube-system名称空间中

But can't in my kube-system namespace:

# kubectl get deploy -nkube-system
Error from server: no kind "Deployment" is registered for version "apps/v1"

此外,apiserver启动的日志:

Also, the logs of apiserver startup:

E0530 10:47:09.511854       1 cacher.go:277] unexpected ListAndWatch error: storage/cacher.go:/daemonsets: Failed to list *extension
s.DaemonSet: no kind "DaemonSet" is registered for version "apps/v1"
E0530 10:47:09.534114       1 cacher.go:277] unexpected ListAndWatch error: storage/cacher.go:/daemonsets: Failed to list *extension
s.DaemonSet: no kind "DaemonSet" is registered for version "apps/v1"
E0530 10:47:09.577678       1 cacher.go:277] unexpected ListAndWatch error: storage/cacher.go:/replicasets: Failed to list *extensio
ns.ReplicaSet: no kind "ReplicaSet" is registered for version "apps/v1"
E0530 10:47:09.580008       1 cacher.go:277] unexpected ListAndWatch error: storage/cacher.go:/deployments: Failed to list *extensio
ns.Deployment: no kind "Deployment" is registered for version "apps/v1"
E0530 10:47:09.580234       1 cacher.go:277] unexpected ListAndWatch error: storage/cacher.go:/deployments: Failed to list *extensio
ns.Deployment: no kind "Deployment" is registered for version "apps/v1"

我们都知道自v1.9.0起添加了API版本apps/v1,那么为什么v1.8.12尝试为"apps/v1"版本注册Deployment?

We all know API version apps/v1 is added since v1.9.0, so why does v1.8.12 try to register Deployment for version "apps/v1" ?

推荐答案

在1.10中,apps API组中的对象开始以apps/v1格式(在1.9中引入)保存在etcd中.

In 1.10, objects in the apps API group began persisting in etcd in apps/v1 format (introduced in 1.9).

从1.10.x回滚到1.9.x是安全的

Rolling back to 1.9.x from 1.10.x is safe

如果要回滚到1.8.x,必须首先往返处理所有apps/v1资源(守护程序集,部署,副本集,状态集),以确保它们以1.8可以读取的格式保存在etcd中.

If you want to roll back further to 1.8.x, you must first round trip all the apps/v1 resources (daemonsets, deployments, replicasets, statefulsets) to ensure they are persisted in etcd in a format that 1.8 can read.

您收到的错误指示etcd中存在kubernetes 1.8 apiserver无法解码的apps/v1内容(因为apps/v1在1.8中不存在).解决方案是升级到1.9.x,获取/放置所有现有的apps/v1资源,然后再次降级到kube 1.8.

The error you are getting indicates there is apps/v1 content in etcd which the kubernetes 1.8 apiserver cannot decode (since apps/v1 didn't exist in 1.8). The solution is to upgrade to 1.9.x, get/put all existing apps/v1 resources before downgrading to kube 1.8 again.

这篇关于Kubernetes v1.8.12无法列出*扩展名.部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆