gpt4 book ai didi

kubernetes - 安装Prometheus监视Kubernetes集群时出错

转载 作者:行者123 更新时间:2023-12-02 11:51:02 25 4
gpt4 key购买 nike

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

最佳答案

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

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

  • kubectl create serviceaccount --namespace kube-system tiller
  • kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
  • kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
  • 关于kubernetes - 安装Prometheus监视Kubernetes集群时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55076280/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com