简体   繁体   English

在 prometheus helm chart values.yaml 中配置 alertmanager 警报

[英]Configure alertmanager alerting in prometheus helm chart values.yaml

I want to connect prometheus to alertmanager and I'm facing a problem with configuring alertmanager alerting endpoints in values.yaml helm chart.我想将 prometheus 连接到 alertmanager,但我在 values.yaml 掌舵图中配置 alertmanager 警报端点时遇到了问题。
I tried it before with docker-compose and it worked but it's different with helm charts.我之前用 docker-compose 尝试过它并且它有效,但它与舵图不同。

I downloaded the official helm chart for prometheus that includes alertmanager I configured the services and the targets to scrape but I can't find where to specify alertmanager to prometheus to try to forward the alerts and send it by slack.我下载了 prometheus 的官方掌舵图,其中包括 alertmanager 我配置了要抓取的服务和目标,但我找不到在哪里将 alertmanager 指定给 prometheus 以尝试转发警报并通过 slack 发送它。

The easiest configuration is set the configMapOverride: https://github.com/helm/charts/blob/da8b2fa27f81a4a4d44e1ac320f9081a5948224e/stable/prometheus/values.yaml#L68最简单的配置是设置 configMapOverride: https : //github.com/helm/charts/blob/da8b2fa27f81a4a4d44e1ac320f9081a5948224e/stable/prometheus/values.yaml#L68

After configuring this, you must create a configMap with all configuration like a usually alertmanager: https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/prometheus/alertmanager-configmap.yaml配置完成后,您必须创建一个 configMap,其中包含所有配置,例如通常的警报管理器: https : //github.com/kubernetes/kubernetes/blob/master/cluster/addons/prometheus/alertmanager-configmap.yaml

If you already moved to kube-prometheus-stack , you could try the following steps:如果您已经转移到kube-prometheus-stack ,您可以尝试以下步骤:

  1. create a values.yaml创建一个 values.yaml

     # values.yaml alertmanager: config: global: resolve_timeout: 5m # The API URL to use for Slack notifications. [ slack_api_url: <secret> ] [ slack_api_url_file: <filepath> ]
  2. apply or upgrade your release applyupgrade您的版本

    helm install|upgrade [RELEASE] prometheus-community/kube-prometheus-stack -f values.yaml

REF:参考:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM