{{- with .Values.alertmanager.receiver.matrix }} {{- if .enabled }} --- apiVersion: helm.toolkit.fluxcd.io/v2beta2 kind: HelmRelease metadata: name: "alertmanager-matrix" spec: chart: spec: sourceRef: kind: "GitRepository" name: "wrenix-helm-charts" namespace: "flux-system" chart: "./alertmanager-matrix" reconcileStrategy: "Revision" install: {{- toYaml $.Values.commons.helm.release.install | nindent 4 }} test: {{- toYaml $.Values.commons.helm.release.test | nindent 4 }} upgrade: {{- toYaml $.Values.commons.helm.release.upgrade | nindent 4 }} driftDetection: {{- toYaml $.Values.commons.helm.release.driftDetection | nindent 4 }} interval: 10m valuesFrom: - kind: Secret name: "global-alertmanager-matrix-token" optional: false valuesKey: token targetPath: bot.matrix.token values: replicaCount: 1 bot: matrix: homeserver: {{ .homeserver | quote }} userID: {{ .userID | quote }} rooms: - {{ .default | quote }} {{- range $item := .rooms }} - {{ $item.room | quote }} {{- end }} alertmanager: "http://kube-prometheus-stack-alertmanager:9093" showLabels: true {{` template: html: > {{ range .Alerts }} {{.StatusString|icon}} {{.StatusString|upper}} {{.AlertName}}
{{if ne .Summary "" }} Summary: {{.Summary}} {{end}} {{if ne .Fingerprint ""}} ({{.Fingerprint}}) {{end}} {{if ne .GeneratorURL ""}} more {{end}} {{- $labels := dict }} {{- range $key, $value := .Alert.Labels }} {{- $labels = set $labels $key $value }} {{- end }}
{{ coalesce $labels.exported_namespace $labels.namespace "unknown" }} {{if $.ShowLabels}}
Labels: {{ range $key := omit $labels "alertname" "severity" "exported_namespace" "namespace" | keys | sortAlpha }} {{ $value := get $labels $key }} {{ end }}
{{ $key }} {{ $value }}
{{end}}
{{- end -}} `}} serviceAccount: create: false podSecurityContext: fsGroup: 1000 securityContext: allowPrivilegeEscalation: false capabilities: drop: - ALL readOnlyRootFilesystem: true runAsUser: 1000 runAsGroup: 1000 resources: requests: memory: "128Mi" cpu: "100m" limits: memory: "256Mi" cpu: 4 tolerations: {{- toYaml $.Values.commons.tolerations | nindent 6 }} affinity: {{- toYaml $.Values.commons.affinity | nindent 6 }} {{- end }} {{- end }}