Kubernetes v1.8.12不能列出* extensions.Deployment(Kube

2019-10-30 08:41发布

大家

最近我升级我的K8S集群v1.10.3,然后我滚回v1.9.8,再到v1.8.12。 从那以后,我发现了一些我无法理解。

我可以在默认的命名空间列出的部署:

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-系统命名空间不是:

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

此外,API服务器启动的日志:

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"

我们都知道API版本的应用程序/ V1是因为v1.9.0增加,所以为什么v1.8.12尝试注册为部署版“应用/ V1”?

Answer 1:

在1.10,该应用程序API组中的对象开始在应用程序/ V1格式(在1.9中引入)ETCD持续。

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

如果您想进一步回滚到1.8.x的,你必须首先往返所有的应用程序/ V1资源(daemonsets,部署,replicasets,statefulsets),以确保它们在ETCD坚持的格式,1.8可以读取。

你所得到的错误指示存在ETCD应用/ V1含量的kubernetes 1.8 API服务器不能解码(因为应用程序/ V1并没有在1.8存在)。 解决的办法是升级到1.9.x的,获取/降级再次KUBE 1.8之前把所有现有的应用程序/ V1资源。



文章来源: Kubernetes v1.8.12 can't list *extensions.Deployment
标签: kubernetes