<p>I created alert rule file.yml and copy it under &quot;/&quot; of prometheus contianer and I added it to the values.yml file  but I can't see the rule in the UI</p>
<pre><code>    prometheus.yml:
    rule_files:
      - /etc/config/recording_rules.yml
      - /etc/config/alerting_rules.yml
      - /custom_alerting_rules.yml
    ## Below two files are DEPRECATED will be removed from this default values file
      - /etc/config/rules
      - /etc/config/alerts

    alerting:
      alertmanagers:
        - static_configs:
            - targets: ['alertmanager:9093'] here i tried the @IP of alert manager service 
</code></pre>
<p>here is the alert file</p>
<pre><code>groups:
  - name: my-custom-alerts
    rules:
      - alert: HighPodCount
        expr: count(kube_pod_info{pod=~&quot;consumer.*&quot;}) &gt; 2
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: High pod count
          description: The number of pods is above the threshold.
</code></pre>
<p>k get svc shows</p>
<pre><code>prometheus-alertmanager               ClusterIP      10.10x.21x.x8    &lt;none&gt;        9093/TCP                       68m
</code></pre>
<p>what am doing wrong ?</p>

trey
<p>From the perspective of Prometheus server, its configuration and rule files are not auto-reloaded. You need to call the <a href="https://prometheus.io/docs/prometheus/latest/management_api/#reload" rel="nofollow noreferrer">Reload</a> management api manually.</p>
<p>There are 3 ways for this purpose:</p>
<ol>
<li>If you're in the prometheus contianer:
<pre class="lang-bash prettyprint-override"><code>curl -XPOST http://:::9090/-/reload
</code></pre>
</li>
<li>If you're in another pod container of the same namespace:
<pre class="lang-bash prettyprint-override"><code># prometheus pod name: prometheus-0
curl -XPOST http://prometheus-0:9090/-/reload
</code></pre>
</li>
<li>If you're out of K8s cluster(i.e. where you run kubectl command):
<pre class="lang-bash prettyprint-override"><code># prometheus pod name: prometheus-0, namespace: monitoring
kubectl port-forward prometheus-0 -nmonitoring 9090:9090
# in another shell
curl -XPOST http://127.0.0.1:9090/-/reload
</code></pre>
</li>
</ol>
