Skip to content

Commit

Permalink
replicaset should not set -alertmanager-cluster-peers when cluster is…
Browse files Browse the repository at this point in the history
… disable

Signed-off-by: AlexandreRoux <alexandreroux42@protonmail.com>
  • Loading branch information
humblebundledore committed Jul 4, 2023
1 parent e909803 commit b9efaee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/alertmanager/alertmanager-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ spec:
args:
- "-target=alertmanager"
- "-config.file=/etc/cortex/cortex.yaml"
{{- if gt (int .Values.alertmanager.replicas) 1}}
{{- if and (gt (int .Values.alertmanager.replicas) 1) (ne .Values.config.alertmanager.cluster.listen_address "") }}
{{- $fullName := include "cortex.alertmanagerFullname" . }}
{{- $peers := list }}
{{- range $i := until (int .Values.alertmanager.replicas) }}
{{- $peer := printf "%s-%d.%s-headless.%s.svc.cluster.local:%s" $fullName $i $.Release.Namespace $.Release.Namespace $svcClusterPort }}
{{- $peer := printf "%s-%d.%s-headless.%s.svc.cluster.local:%s" $fullName $i $fullName $.Release.Namespace $svcClusterPort }}
{{- $peers = append $peers $peer }}
{{- end }}
- "-alertmanager.cluster.peers={{ join "," $peers }}"
Expand Down

0 comments on commit b9efaee

Please sign in to comment.