kubernetes Consul Helm安装错误,在版本“rbac.authorization.k8s.io/v1beta1”中没有匹配的类型“ClusterRole”

velaa5lx  于 2023-08-03  发布在  Kubernetes
关注(0)|答案(1)|浏览(137)

我正在尝试安装执政官舵图,版本10.12.6从bitnami链接https://artifacthub.io/packages/helm/bitnami/consul。但当我运行terraform apply命令时,它显示以下错误

Error: unable to build kubernetes objects from release manifest: [resource mapping not found for name: "devt2-d1-***-consul-tls-init-cleanup" namespace: "devt2-d1" from "": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1beta1"

字符串
以下是我使用的软件版本

Kubernetes EKS群集版本

1.23

kubectl版本

Client Version: version.Info{Major:"1", Minor:"24+", GitVersion:"v1.24.13-eks-0a21954", GitCommit:"6305d65c340554ad8b4d7a5f21391c9fa34932cb", GitTreeState:"clean", BuildDate:"2023-04-15T00:37:31Z", GoVersion:"go1.19.8", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"23+", GitVersion:"v1.23.17-eks-a5565ad", GitCommit:"23f44c7dd4e8e23856387345e7cb80bf0f93ced6", GitTreeState:"clean", BuildDate:"2023-06-15T21:19:39Z", GoVersion:"go1.19.6", Compiler:"gc", Platform:"linux/amd64"}

舵型

version.BuildInfo{Version:"v3.11.3", GitCommit:"323249351482b3bbfc9f5004f65d400aa70f9ae7", GitTreeState:"clean", GoVersion:"go1.20.3"}

地形版本

Terraform v1.5.3


我查了领事的档案,
**consul/charts/common/templates/_capabilities.tpl**和我找到下面代码

{{/*
Return the appropriate apiVersion for RBAC resources.
*/}}
{{- define "common.capabilities.rbac.apiVersion" -}}
{{- if semverCompare "<1.17-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "rbac.authorization.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "rbac.authorization.k8s.io/v1" -}}
{{- end -}}
{{- end -}}


semverCompare比较似乎失败,因此它添加了rbac.authorization.k8s.io/v1beta1版本。由于,我使用的是Kubernetes的1.23版本,因此它应该采取的rbac.authorization.k8s.io/v1
你能帮我解决这个错误吗?

irlmq6kh

irlmq6kh1#

最后我解决了这个问题。
正如注解中所建议的,我在values.yaml文件中使用了kubeVersion,但没有将值设置为1.23,而是将其设置为1.23-0,然后它就可以正常工作了。

相关问题