安装Prometheus监视Kubernetes集群时出错

时间:2019-03-09 10:17:05

标签: kubernetes prometheus prometheus-operator

我正在安装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

1 个答案:

答案 0 :(得分:2)

在没有服务帐户具有适当群集角色(cluster-admin)的情况下部署Tiller(Helm安装程序的服务器端)时,这是一种典型情况。

您需要先修复Helm设置,才能继续进行here中所述的prometheus-operator安装,或者直接一个接一个地运行以下命令:

  1. kubectl创建serviceaccount --namespace kube-system分er
  2. kubectl创建clusterrolebinding耕till机-集群规则-clusterrole =集群管理--serviceaccount = kube-system:耕种机
  3. kubectl修补程序部署--namespace kube-system tiller-deploy -p'{“ spec”:{“ template”:{“ spec”:{“ serviceAccount”:“ tiller”}}}}}'