1

我正在安装 prometheus 来监控 K8S,但我遇到了这个错误。你能帮助我吗?非常感谢!!

helm version
Client: &version.Version{SemVer:"v2.13.0", 
GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.0", 
GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}

helm install stable/prometheus-operator --name prometheus-operator --namespace monitoring

Error: customresourcedefinitions.apiextensions.k8s.io "alertmanagers.monitoring.coreos.com" is forbidden: User "system:serviceaccount:kube-system:default" cannot delete resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
4

1 回答 1

6

这是在没有具有适当集群角色 (cluster-admin) 的服务帐户的情况下部署 Tiller(Helm 设置的服务器端)时的典型情况。

您需要首先修复您的 Helm 设置,以便能够继续进行 prometheus-operator 安装,如此所述,或者直接逐个运行以下命令:

  1. kubectl create serviceaccount --namespace kube-system tiller
  2. kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
  3. kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
于 2019-03-11T09:29:32.077 回答