Score:0

prometheus-operator when configuring alertmanager config for PagerDuty

is flag

Have next issue: When try to set up alertmanager configuration over CRD, get wrong configuration on pod. Problem look like:

- routing_key: |
      *****

routing_key parameter after all CD use multiline string type, and it crash configuration - alertmanager don't understand it as pagerduty config and don't use default template for custom configuration. It not made expected json for PD and PD send back status code 400. Expected configuration look like:

- routing_key: ****

But it only, if I use CRD. If I set up it without CRD (in global values) it worked fine.

More information:

config.yaml:

route:
  groupBy: ['alertname', 'namespace']
  groupWait: 10s
  groupInterval: 30s
  repeatInterval: 30m
  receiver: 'pagerDuty'
  continue: true
receivers:
- name: 'pagerDuty'
  pagerdutyConfigs:
  - url: 'https://events.eu.pagerduty.com/v2/enqueue'
    routingKey: { name: name_of_secret, key: ke_of_secret }

Helm chart temlate for build it to CRD:

{{- $files := .Files.Glob "alerting/**/config.yaml" }}
{{- if $files }}
{{- range $path, $fileContents := $files }}
---
{{- $namespace := regexReplaceAll "^.*/(.*?)/.*" $path "${1}"}}
apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: {{ printf "%s-%s" $namespace "alertmanager-config" }}
  namespace: {{ $namespace }}
spec: {{ $.Files.Get $path | nindent 2}}
{{- end }}
{{- end }}

After it go to ArgoCD and sync with wrong type routing_key.

Try it with v1 API(uses service_key), same problem.

Anyone have same problem? How fix it? Try a lot, but think - it a bug.

Score:0
uz flag

I had the same issue with emailConfig.

It was due to my password base64 encoded in the secret with \n at the end.

You should try to generate your secret base64 string like this using the -n:

echo -n "secretstring" | base64

I hope this help.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.