gpt4 book ai didi

docker - Prometheus的AlertManager中的CrashLoopBackOff

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

我正在尝试为我的Kubernetes集群设置AlertManager。我遵循了这份文档(https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/getting-started.md)->一切正常。

为了设置AlertManager,我正在研究此文档(https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/alerting.md)

我正在获取CrashLoopBackOffalertmanager-example-0。请检查随附的日志:

第一张图片:$ kubectl logs -f prometheus-operator-88fcf6d95-zctgw -n monitoring
第二张图片:$ kubectl describe pod alertmanager-example-0
enter image description here
enter image description here

谁能指出我做错了什么?提前致谢。

最佳答案

听起来您遇到了一个问题,即警报管理器 Pane 使用的RBACService Account(system:serviceaccount:monitoring:prometheus-operator)没有足够的权限与kube-apiserver对话。

对于您的Prometheus运算符,它具有如下所示的ClusterRoleBinding prometheus-operator:

$ kubectl get clusterrolebinding prometheus-operator -o=yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: prometheus-operator
name: prometheus-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus-operator
subjects:
- kind: ServiceAccount
name: prometheus-operator
namespace: monitoring

更重要的是, ClusterRole应该看起来像这样:
$ kubectl get clusterrole prometheus-operator -o=yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app: prometheus-operator
name: prometheus-operator
rules:
- apiGroups:
- extensions
resources:
- thirdpartyresources
verbs:
- '*'
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- '*'
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanager
- alertmanagers
- prometheus
- prometheuses
- service-monitor
- servicemonitors
- prometheusrules
verbs:
- '*'
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- '*'
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- delete
- apiGroups:
- ""
resources:
- services
- endpoints
verbs:
- get
- create
- update
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
- watch

关于docker - Prometheus的AlertManager中的CrashLoopBackOff,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53545717/

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