英文:
no matches for kind "RoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
问题
I try to deploy a spring api-gateway app to GKE using jenkins and helm chart
for RoleBinding I have this manifest
apiVersion: v1
kind: ServiceAccount
metadata:
name: api-gateway-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: api-gateway-cr
rules:
- apiGroups: [""]
resources: [ "services", "pods", "configmaps", "endpoints" ]
verbs: [ "get", "watch", "list" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: api-gateway-rb
namespace: default
roleRef:
kind: ClusterRole
name: api-gateway-cr
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: api-gateway-sa
and have this command
helm upgrade --install -f helm-values/values.stag.common.yaml -f helm-values/values.stag.secret.yaml -f helm-values/values.stag.yaml stag-api-gateway helm-api-gateway || build_error=true
But I keep getting error this
Error: UPGRADE FAILED: current release manifest contains removed kubernetes api(s) for this kubernetes version and it is therefore unable to build the kubernetes objects for performing the diff. error from kubernetes: unable to recognize "": no matches for kind "RoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
What I had done:
- Update kubernetes version in jenkins-slave node to 1.20
- make sure that all manifest using rbac.authorization.k8s.io/v1
What can I do next?
英文:
I try to deploy a spring api-gateway app to GKE using jenkins and helm chart
for RoleBinding I have this manifest
apiVersion: v1
kind: ServiceAccount
metadata:
name: api-gateway-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: api-gateway-cr
rules:
- apiGroups: [""]
resources: [ "services", "pods", "configmaps", "endpoints" ]
verbs: [ "get", "watch", "list" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: api-gateway-rb
namespace: default
roleRef:
kind: ClusterRole
name: api-gateway-cr
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: api-gateway-sa
and have this command
helm upgrade --install -f helm-values/values.stag.common.yaml -f helm-values/values.stag.secret.yaml -f helm-values/values.stag.yaml stag-api-gateway helm-api-gateway || build_error=true
But I keep getting error this
Error: UPGRADE FAILED: current release manifest contains removed kubernetes api(s) for this kubernetes version and it is therefore unable to build the kubernetes objects for performing the diff. error from kubernetes: unable to recognize "": no matches for kind "RoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
What I had done:
- Update kubernetes version in jenkins-slave node to 1.20
- make sure that all manifest using rbac.authorization.k8s.io/v1
What can I do next?
答案1
得分: 1
-
运行命令
kubectl version
来检查您正在使用的 Kubernetes 版本。确保您正在使用最新的 Kubernetes 和 Helm 版本 以支持rbac.authorization.k8s.io/v1
。 -
检查您的清单中的
apiVersion
字段,以确认它支持 RoleBinding,并且与您的 Kubernetes 集群支持的版本相对应。 -
错误和清单文件中的 API 版本不同,请检查是否在更新清单文件中的版本后使用了以下命令。
Kubectl apply -f <file name>
更多信息,请参考以下官方文档 RBAC Authorization,Deprecated API Migration Guide。
英文:
-
Run the command
kubectl version
to check the version of Kubernetes you're using. Make sure that you are using the latest kubernetes and Helm version to supportrbac.authorization.k8s.io/v1
. -
Examine the
apiVersion
field in your manifest to confirm it supports RoleBinding and it corresponds to the version supported by your Kubernetes cluster. -
The API version is different in the error and the manifest file, Check whether you used the below command after updating the version in the manifest file.
> Kubectl apply -f <file name>
Refer to the following official docs RBAC Authorization, Deprecated API Migration Guide for more information
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论