<p>We are using helm of prometheus operator chart stable, <a href="https://github.com/helm/charts/blob/master/stable/prometheus-operator/values.yaml" rel="nofollow noreferrer">see this link for the source</a> </p>

<p>and we use our <code>values.yaml</code> which works OK,
in the value.yaml we are configing prometheus (men cpu etc) and the alertmanger.</p>

<p>Now I need to add the prometheus alert manger config, but not sure how to provide it via the values.yaml (tried, it doesn’t work)</p>

<p>Any idea how to pass the config of the alert manager ? </p>

<p>This is the value.yaml</p>

<pre><code>grafana:
  enabled: true
alertmanager:
  enabled: false
  alertmanagerSpec:
    replicas: 3

</code></pre>

<p>Now I need to  provide in addition file which contain the alert manager rules</p>

<p>like the following:</p>

<p>file: <code>alerts.yaml</code></p>

<pre><code>
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
</code></pre>

<p>How should I pass also the <code>alerts.yaml</code> via the helm installation ? </p>

<p><code>helm install prom stable/prometheus-operator -n mon -f values.yaml</code>  </p>

<p>should I create my own chart and put it on template ? if so how it’s recommended for clean implementation ? </p>

<p>There is no way to reference a external yaml file while running <code>helm install</code>.</p>

<p>The best way to achieve this is to copy the chart and include it to templates folder. </p>

<p>From helm documentation we can read: </p>

<blockquote>
  <h3>Templates</h3>
  
  <p>The most important piece of the puzzle is the  <em>templates/</em> 
  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  <em>helm install</em>  command.</p>
</blockquote>

<pre><code>$ git clone https://github.com/helm/charts.git

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

$ helm install --name my-release stable/prometheus-adapter
</code></pre>
