gpt4 book ai didi

azure - Helm 3 安装多个配置文件

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

我们正在使用 Prometheus Operator Chart stable 的 helm,see this link for the source

我们使用我们的 values.yaml ,它工作正常,在 value.yaml 中,我们配置 prometheus(men cpu 等)和alertmanger。

现在我需要添加普罗米修斯警报管理器配置,但不确定如何通过values.yaml提供它(尝试过,但不起作用)

知道如何传递警报管理器的配置吗?

这是 value.yaml

grafana:
enabled: true
alertmanager:
enabled: false
alertmanagerSpec:
replicas: 3

现在我需要提供包含警报管理器规则的附加文件

如下所示:

文件:alerts.yaml


apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
creationTimestamp: null
labels:
prometheus: prometheus
role: alert-rules
name: prometheus-prometheus-rules
namespace: mon
spec:
groups:
- name: ./prometheus.rules
rules:
- alert: CRITICAL - nodes Disk Pressure
expr: 'kube_node_labels{label_workern_cloud_io_group=“ds"} * on(node)kube_node_status_condition{condition="DiskPressure", status="true"} == 1'
for: 5m
labels:
severity: CRITICAL

我应该如何通过 helm 安装传递 alerts.yaml

helm install prom stable/prometheus-operator -n mon -f value.yaml

我应该创建自己的图表并将其放在模板上吗?如果是这样,如何建议干净实现?

最佳答案

运行 helm install 时无法引用外部 yaml 文件。

实现此目的的最佳方法是复制图表并将其包含到模板文件夹中。

从 helm 文档中我们可以读到:

Templates

The most important piece of the puzzle is the templates/ directory. This is where Helm finds the YAML definitions for your Services, Deployments and other Kubernetes objects. If you already have definitions for your application, all you need to do is replace the generated YAML files for your own. What you end up with is a working chart that can be deployed using the helm install command.

$ git clone https://github.com/helm/charts.git

$ cp alerts.yaml ./charts/stable/prometheus-adapter/templates

$ helm install --name my-release stable/prometheus-adapter

关于azure - Helm 3 安装多个配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59467026/

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