prometheus-operator问题集

prometheus-operator日志报错:

ts=2020-08-12T05:50:28.097955328Z caller=main.go:199 msg="Starting Prometheus Operator version '0.34.0'."
ts=2020-08-12T05:50:28.661052867Z caller=main.go:96 msg="Staring insecure server on :8080"
level=info ts=2020-08-12T05:50:28.770870304Z caller=operator.go:441 component=prometheusoperator msg="connection established" cluster-version=v1.16.6
level=info ts=2020-08-12T05:50:28.770889775Z caller=operator.go:219 component=alertmanageroperator msg="connection established" cluster-version=v1.16.6
ts=2020-08-12T05:50:29.765188929Z caller=main.go:315 msg="Unhandled error received. Exiting..." err="getting CRD: Alertmanager: customresourcedefinitions.apiextensions.k8s.io \"alertmanagers.monitoring.coreos.com\" is forbidden: User \"system:serviceaccount:monitoring:prometheus-operator\" cannot get resource \"customresourcedefinitions\" in API group \"apiextensions.k8s.io\" at the cluster scope"

原有的clusterrole.yaml内容

rules:
- apiGroups:
  - apiextensions.k8s.io
  resources:
  - customresourcedefinitions
  verbs:
  - '*'

现在的clusterrole.yaml内容

rules:
- apiGroups:
  - apiextensions.k8s.io
  resources:
  - customresourcedefinitions
  resourceNames:
  - alertmanagers.monitoring.coreos.com
  - prometheuses.monitoring.coreos.com
  - podmonitors.monitoring.coreos.com
  - prometheusrules.monitoring.coreos.com
  - servicemonitors.monitoring.coreos.com
  verbs:
  - '*'

问题解决。

你可能感兴趣的:(prometheus-operator问题集)