2

my alertmanagerconfigs:

apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: configlinkflowalertmanager
  labels:
    alertmanagerConfig: linkflowAlertmanager
spec:
  route:
    groupBy: ['alertname']
    groupWait: 30s
    groupInterval: 5m
    repeatInterval: 12h
    receiver: 'webhook'
    matchers:
      - name: alertname
        value: KubePodCrashLooping
      - name: namespace
        value: linkflow
  receivers:
  - name: 'webhook'
    webhookConfigs:
    - url: 'http://xxxxx:1194/'

the web shows: namespace become monitoring ? why? and alerts only in monitoring can send out can I send other namespace or all namespace alerts?

route:
  receiver: Default
  group_by:
  - namespace
  continue: false
  routes:
  - receiver: monitoring-configlinkflowalertmanager-webhook
    group_by:
    - namespace
    match:
      alertname: KubePodCrashLooping
      namespace: monitoring
    continue: true
    group_wait: 30s
    group_interval: 5m
    repeat_interval: 12h
renemadsen
  • 161
  • 1
  • 9

1 Answers1

2

This is a feature:

That's kind of the point of the feature, otherwise it's possible that alertmanager configs in different namespaces conflict and Alertmanager won't be able to start.

There is an Issue (#3737) to make namespace label matching optional / configurable. The related PR still has to be merged (as of Today), but it will allow you to define global alerts.

papanito
  • 2,349
  • 2
  • 32
  • 60