Skip to content

Commit

Permalink
configure alertmanager cluster peers as comma seperated list
Browse files Browse the repository at this point in the history
Signed-off-by: AlexandreRoux <alexandreroux42@protonmail.com>
  • Loading branch information
AlexandreRoux committed Jul 3, 2023
1 parent 8d22e3a commit 1d830da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templates/alertmanager/alertmanager-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,12 @@ spec:
- "-config.file=/etc/cortex/cortex.yaml"
{{- if gt (int .Values.alertmanager.replicas) 1}}
{{- $fullName := include "cortex.alertmanagerFullname" . }}
{{- $peers := list }}
{{- range $i := until (int .Values.alertmanager.replicas) }}
- "-alertmanager.cluster.peers={{ $fullName }}-{{ $i }}.{{ $fullName }}-headless.{{ $.Release.Namespace }}.svc.cluster.local:{{ $svcClusterPort }}"
{{- $peer := printf "%s-%d.%s-headless.%s.svc.cluster.local:%s" $fullName $i $.Release.Namespace $.Release.Namespace $svcClusterPort }}
{{- $peers = append $peers $peer }}
{{- end }}
- "-alertmanager.cluster.peers={{ join "," $peers }}"
{{- end }}
{{- range $key, $value := .Values.alertmanager.extraArgs }}
- "-{{ $key }}={{ $value }}"
Expand Down

0 comments on commit 1d830da

Please sign in to comment.