Hey all, i have a secret containing the config for...
# fleet
b
Hey all, i have a secret containing the config for our AlertManager, i would like to customise the
routing_key
for each cluster using Fleet, is this possible? We're using a multi-cluster Kustomize structure https://github.com/rancher/fleet-examples/tree/master/multi-cluster/kustomize and here is an abridged version of our AM config:
Copy code
apiVersion: v1
kind: Secret
metadata:
  name: cloudops-monitoring-alertmanager
  namespace: cattle-monitoring-system
type: Opaque
data:
  rancher_defaults.tmpl: >-
    [...]
stringData:
  alertmanager.yaml: |-
    global:
      slack_api_url: <https://hooks.slack.com/services/[...]>
      resolve_timeout: 5m
    route:
      group_by: [...]
      group_interval: 1m
      group_wait: 1s
      receiver: 'null'
      routes:
      - match:
          namespace: cattle-monitoring-system
          alertname: CPUThrottlingHigh
        receiver: 'null'
      - match_re:
          namespace: cattle-system|kube-system|fleet-system|cattle-monitoring-system|loki|cattle-dashboards|default
        receiver: cloudops
      - match:
          alertname: Watchdog
        receiver: 'null'
      - match:9
          alertname: KubeMemoryOvercommit
        receiver: 'null'
      - match:
          alertname: KubeCPUOvercommit
        receiver: 'null'
      [...]

    receivers:
    - name: "null"

    - name: cloudops
      pagerduty_configs:
        - routing_key: [...] <--- should be Kustomized
          send_resolved: true
          severity: '{{ if eq .CommonLabels.severity "critical" }}critical{{ else if eq .CommonLabels.severity "error" }}error{{ else if eq .CommonLabels.severity "warning" }}warning{{ else if eq .CommonLabels.severity "info" }}info{{ else }}critical{{ end }}'
          group: '{{ if .CommonLabels.cluster }}{{ .CommonLabels.cluster }}{{ end }}'

    [...]