Error when install prometheus to monitor Kubernetes Cluster

我的未来我决定 提交于 2019-12-13 00:59:54

问题


I am installing prometheus to monitor K8S but I met this error. Can you help me? Thank you so much!!

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

回答1:


This is a typical situation when Tiller (server side of Helm setup) is deployed without a service account having appropriate cluster role (cluster-admin).

You need to fix your Helm setup first, to be able to proceed with prometheus-operator installation, as described here, or by running the below commands directly one by one:

  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"}}}}'


来源:https://stackoverflow.com/questions/55076280/error-when-install-prometheus-to-monitor-kubernetes-cluster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!