<p>I've Prometheus operator which is <strong>working as expected</strong> 
<a href="https://github.com/coreos/prometheus-operator" rel="nofollow noreferrer">https://github.com/coreos/prometheus-operator</a></p>

<p>Now I want to apply the <a href="https://prometheus.io/docs/alerting/alertmanager/" rel="nofollow noreferrer">alert manager</a> from scratch  </p>

<p>After reading the docs im came out with those yamls.
but the problem is when I entered to the UI 
Nothing is shown, any idea what I miss here ? </p>

<p><a href="http://localhost:9090/alerts" rel="nofollow noreferrer">http://localhost:9090/alerts</a> 
I use port forwarding ...</p>

<p>This is <code>all</code> the config files I've apply to my k8s cluster
I just want to do some simple test to see that it working and then extend it to our needs...</p>

<p><code>alertmanger_main.yml</code></p>

<pre><code>---
apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
  name: main
  labels:
    alertmanager: main
spec:
  replicas: 3
  version: v0.14.0
</code></pre>

<p><code>alertmanger_service.yml</code></p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: alertmanager-main
spec:
  type: LoadBalancer
  ports:
  - name: web
    port: 9093
    protocol: TCP
    targetPort: web
  selector:
    alertmanager: main
</code></pre>

<p><code>testalert.yml</code> </p>

<pre><code>kind: ConfigMap
apiVersion: v1
metadata:
  name: prometheus-example-rules
  labels:
    role: prometheus-rulefiles
    prometheus: prometheus
data:
  example.rules.yaml: |+
    groups:
    - name: ./example.rules
      rules:
      - alert: ExampleAlert
        expr: vector(1)
</code></pre>

<p><code>alertmanager.yml</code></p>

<pre><code>global:
  resolve_timeout: 5m
route:
  group_by: ['job']
  group_wait: 30s
  group_interval: 5m
  repeat_interval: 12h
  receiver: 'webhook'
receivers:
- name: 'webhook'
  webhook_configs:
  - url: 'http://alertmanagerwh:30500/'
</code></pre>

<p>and to create secret I use </p>

<p><code>kubectl create secret generic alertmanager-main --from-file=alertmanager.yaml</code></p>

<p>what I need is some basic alerts in K8S and I follow the documatation but didnt find any good step by step tutorial   </p>

<p><a href="https://i.stack.imgur.com/aTDBb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aTDBb.png" alt="enter image description here"></a></p>

<pre><code>to check my sys for monitoring namespace

 ~  kubectl get pods -n monitoring                                                                                                                                                13.4m  Sun Feb 17 18:48:16 2019
NAME                                  READY   STATUS    RESTARTS   AGE
kube-state-metrics-593czc6b4-mrtkb   2/2     Running   0          12h
monitoring-grafana-771155cbbb-scqvx   1/1     Running   0          12h
prometheus-operator-79f345dc67-nw5zc   1/1     Running   0          12h
prometheus-prometheus-0               3/3     Running   1          12h
 ~  kubectl get svc -n  monitoring                                                                                                                                                536ms  Sun Feb 17 21:04:51 2019
NAME                   TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
alertmanager-main   NodePort    100.22.170.666   &lt;none&gt;        9093:30904/TCP   4m53s
kube-state-metrics     ClusterIP   100.34.212.596   &lt;none&gt;        8080/TCP         4d7h
monitoring-grafana     ClusterIP   100.67.230.884   &lt;none&gt;        80/TCP           4d7h
prometheus-operated    ClusterIP   None             &lt;none&gt;        9090/TCP         4d7h
</code></pre>

<p>I've also now changed the service to LoadBalancer and I try to enter like </p>

<pre><code> ~  kubectl get svc -n  monitoring                                                                                                                                                507ms  Sun Feb 17 21:23:56 2019
NAME                   TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)          AGE
alertmanager-main   LoadBalancer   100.22.170.666   38.482.152.331   9093:30904/TCP   23m
</code></pre>

<p>when I hit the browser with</p>

<pre><code>38.482.152.331:9093 
38.482.152.331:30904 
</code></pre>

<p>nothing happen...</p>

Jenny M
<p>When you consider using <a href="https://prometheus.io/docs/alerting/alertmanager/" rel="nofollow noreferrer">AlertManager</a>, besides the general configuration and applying alert rules, <code>AlertManager</code> requires being integrated with a <a href="https://prometheus.io/" rel="nofollow noreferrer">Prometheus</a> server. The Prometheus instance can then track any incoming series of events, and once it detects any rule which is recognized, it triggers an alert to the nested alertmanager.</p>

<p>In order to enable alerting it might be necessary to append the following config the to Prometheus instance:</p>

<pre><code>alerting:
  alertmanagers:
  - static_configs:
    - targets:
      - 'alertmanagerIP:9093'
</code></pre>

<p>Specifically, for <code>AlertManager</code> implementation in <a href="https://coreos.com/" rel="nofollow noreferrer">CoreOS</a>, you can follow the steps described in the official <a href="https://coreos.com/operators/prometheus/docs/latest/user-guides/alerting.html" rel="nofollow noreferrer">Alerting</a> documentation; however, below you can find example for Prometheus pod alerting configuration kept from the mentioned guideline:</p>

<pre><code>apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  name: example
spec:
  replicas: 2
  alerting:
    alertmanagers:
    - namespace: default
      name: alertmanager-example
      port: web
  serviceMonitorSelector:
    matchLabels:
      team: frontend
  resources:
    requests:
      memory: 400Mi
  ruleSelector:
    matchLabels:
      role: prometheus-rulefiles
      prometheus: example
</code></pre>
