'How do i send alerts to opsgenie using alertmanager?

im desperatly tring to figure out whats going on with alertmanager in my kubernetes cluster. I have been following the getting started for alertmanager

Prometheus works fine out of the box and hooking up alertmanager to recieve the alerts was not an issue. However when it comes to alertmanager routing the alerts to correct reciever im just out of ideas.

This is my alertmanager yaml.

apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  namespace: monitoring
  name: alertmanager-config
  labels:
    alertmanagerConfig: alertmanager-config
spec:
  route:
    groupBy: ['job']
    groupWait: 30s
    groupInterval: 5m
    repeatInterval: 12h
    receiver: opsgenie
  receivers:
  - name: opsgenie
    opsgenieConfigs:
    - apiKey:
        name: opsgenie-config
        key: apiSecret
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
  name: opsgenie-config
  namespace: monitoring
data:
  apiSecret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

And here is my alertmanager config

apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
  name: alert-manager
  namespace: monitoring
  labels:
    app: alertmanager
spec:
  replicas: 1
  alertmanagerConfigSelector:
    matchLabels:
      alertmanagerConfig: alertmanager-config
  tolerations:
    - effect: NoSchedule
      key: type
      operator: Equal
      value: monitoring
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
          - matchExpressions:
              - key: type
                operator: In
                values:
                  - monitoring

This is the loaded config when i look in the status interface in the alertmanager web interface.

enter image description here

My problem comes to that i cannot get the alerts to get routed through my opsgenie reciever. Instead there is a NULL reciever that eats all the alerts and nothing gets sent to my opsgenie.

enter image description here

Please if anybody have an idea help a friend out :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source