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

标签 azure kubernetes kubernetes-helm

我们正在使用 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/

相关文章:

elasticsearch - Kubernetes Persistent Volume在GCE上不起作用

linux - Helm install from stable got no available release name found 错误

kubernetes - Airflow 无法将日志写入 s3 (v1.10.9)

c# - 通过 C# .NET Framework 托管数据工厂将数据从 Blob 复制到 Azure SQL 时忽略坏行

c# - Azure 主题辅助角色在 60 秒后停止处理消息

kubernetes - Rancher 与 Kubernetes 有何不同

kubernetes - 简单入门 Istio Helm 安装

c# - Xamarin Forms 拉取异步表。CreateQuery() 默认添加了 OFFSET

azure - 服务主体 : Set-AzureRmKeyVaultAccessPolicy : Insufficient privileges to complete the operation

java - 从Spring Boot API(K8s,Docker,Spring,Java)解耦数据库连接字符串