类型“部署"没有匹配项在版本“extensions/v1beta1"中 [英] no matches for kind "Deployment" in version "extensions/v1beta1"

查看:29
本文介绍了类型“部署"没有匹配项在版本“extensions/v1beta1"中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在部署 mojaloop 时,Kubernetes 响应以下错误:

While deploying mojaloop, Kubernetes responds with the following errors:

错误:验证失败:[无法识别":没有匹配的种类部署"在apps/v1beta2"版本中,无法识别":否匹配类型部署"在版本extensions/v1beta1"中,无法识别":没有匹配类型StatefulSet";在版本apps/v1beta2",无法识别":没有匹配的种类有状态集"在版本apps/v1beta1"]

Error: validation failed: [unable to recognize "": no matches for kind "Deployment" in version "apps/v1beta2", unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1", unable to recognize "": no matches for kind "StatefulSet" in version "apps/v1beta2", unable to recognize "": no matches for kind "StatefulSet" in version "apps/v1beta1"]

我的 Kubernetes 版本是 1.16.
如何解决 API 版本的问题?
通过调查,我发现Kubernetes不支持apps/v1beta2、apps/v1beta1.
如何让 Kubernetes 使用未弃用的版本或其他受支持的版本?

My Kubernetes version is 1.16.
How can I fix the problem with the API version?
From investigating, I have found that Kubernetes doesn't support apps/v1beta2, apps/v1beta1.
How can I make Kubernetes use a not deprecated version or some other supported version?

我是 Kubernetes 的新手,任何可以支持我的人我都很高兴

I am new to Kubernetes and anyone who can support me I am happy

推荐答案

在 Kubernetes 1.16 中,一些 api 已更改.

In Kubernetes 1.16 some apis have been changed.

您可以使用

$ kubectl api-resources | grep deployment
deployments                       deploy       apps                           true         Deployment

这意味着只有带有 apps 的 apiVersion 才适用于部署(extensions 不支持 Deployment).与 StatefulSet 的情况相同.

This means that only apiVersion with apps is correct for Deployments (extensions is not supporting Deployment). The same situation with StatefulSet.

您需要将 Deployment 和 StatefulSet apiVersion 更改为 apiVersion: apps/v1.

You need to change Deployment and StatefulSet apiVersion to apiVersion: apps/v1.

如果这没有帮助,请将您的 YAML 添加到问题中.

If this does not help, please add your YAML to the question.

编辑由于问题是由部署中包含旧 apiVersions 的 HELM 模板引起的,1.16 版不支持,因此有两种可能的解决方案:

EDIT As issue is caused by HELM templates included old apiVersions in Deployments which are not supported in version 1.16, there are 2 possible solutions:

1. git clone 整个 repo 并将所有模板/deployment.yaml 中的 apiVersion 替换为 apps/v1 使用脚本
2. 当验证器接受 extensions 作为 DeploymentapiVersion 时,使用旧版本的 Kubernetes (1.15)StatefulSet.

1. git clone whole repo and replace apiVersion to apps/v1 in all templates/deployment.yaml using script
2. Use older version of Kubernetes (1.15) when validator accept extensions as apiVersion for Deployment and StatefulSet.

这篇关于类型“部署"没有匹配项在版本“extensions/v1beta1"中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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