“rbac.authorization.k8s.io/v1beta1” 版本中没有找到 “RoleBinding” 类型的匹配。

huangapple go评论61阅读模式
英文:

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

  1. 运行命令 kubectl version 来检查您正在使用的 Kubernetes 版本。确保您正在使用最新的 Kubernetes 和 Helm 版本 以支持 rbac.authorization.k8s.io/v1

  2. 检查您的清单中的 apiVersion 字段,以确认它支持 RoleBinding,并且与您的 Kubernetes 集群支持的版本相对应。

  3. 错误和清单文件中的 API 版本不同,请检查是否在更新清单文件中的版本后使用了以下命令。

Kubectl apply -f <file name>

更多信息,请参考以下官方文档 RBAC AuthorizationDeprecated API Migration Guide

英文:
  1. 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 support rbac.authorization.k8s.io/v1.

  2. Examine the apiVersion field in your manifest to confirm it supports RoleBinding and it corresponds to the version supported by your Kubernetes cluster.

  3. 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 &lt;file name&gt;

Refer to the following official docs RBAC Authorization, Deprecated API Migration Guide for more information

huangapple
  • 本文由 发表于 2023年5月10日 14:34:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76215496.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定