summaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/prometheus-operator/templates/alertmanager/alertmanager.yaml
blob: 6446646697c434dee747a4f0e76ccebf7ea648c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{{- if .Values.alertmanager.enabled }}
apiVersion: {{ printf "%s/v1" (.Values.prometheusOperator.crdApiGroup | default "monitoring.coreos.com") }}
kind: Alertmanager
metadata:
  name: {{ template "prometheus-operator.fullname" . }}-alertmanager
  labels:
    app: {{ template "prometheus-operator.name" . }}-alertmanager
{{ include "prometheus-operator.labels" . | indent 4 }}
spec:
{{- if .Values.alertmanager.alertmanagerSpec.image }}
  baseImage: {{ .Values.alertmanager.alertmanagerSpec.image.repository }}
  version: {{ .Values.alertmanager.alertmanagerSpec.image.tag }}
{{- end }}
  replicas: {{ .Values.alertmanager.alertmanagerSpec.replicas }}
  listenLocal: {{ .Values.alertmanager.alertmanagerSpec.listenLocal }}
  serviceAccountName: {{ template "prometheus-operator.alertmanager.serviceAccountName" . }}
{{- if .Values.alertmanager.alertmanagerSpec.externalUrl }}
  externalUrl: "{{ .Values.alertmanager.alertmanagerSpec.externalUrl }}"
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.externalUrl }}
  externalUrl: "{{ .Values.alertmanager.alertmanagerSpec.externalUrl }}"
{{- else if .Values.alertmanager.ingress.enabled }}
  externalUrl: "http://{{ index .Values.alertmanager.ingress.hosts 0 }}{{ .Values.alertmanager.alertmanagerSpec.routePrefix }}"
{{- else }}
  externalUrl: http://{{ template "prometheus-operator.fullname" . }}-alertmanager.{{ .Release.Namespace }}:9093
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.nodeSelector }}
  nodeSelector:
{{ toYaml .Values.alertmanager.alertmanagerSpec.nodeSelector | indent 4 }}
{{- end }}
  paused: {{ .Values.alertmanager.alertmanagerSpec.paused }}
  logLevel:  {{ .Values.alertmanager.alertmanagerSpec.logLevel | quote  }}
  retention: {{ .Values.alertmanager.alertmanagerSpec.retention | quote  }}
{{- if .Values.alertmanager.alertmanagerSpec.secrets }}
  secrets:
{{ toYaml .Values.alertmanager.alertmanagerSpec.secrets | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.configMaps }}
  configMaps:
{{ toYaml .Values.alertmanager.alertmanagerSpec.configMaps | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.resources }}
  resources:
{{ toYaml .Values.alertmanager.alertmanagerSpec.resources | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.routePrefix }}
  routePrefix: "{{ .Values.alertmanager.alertmanagerSpec.routePrefix }}"
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.securityContext }}
  securityContext:
{{ toYaml .Values.alertmanager.alertmanagerSpec.securityContext | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.storage }}
  storage:
{{ toYaml .Values.alertmanager.alertmanagerSpec.storage | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.podMetadata }}
  podMetadata:
{{ toYaml .Values.alertmanager.alertmanagerSpec.podMetadata | indent 4 }}
{{- end }}
{{- if eq .Values.alertmanager.alertmanagerSpec.podAntiAffinity "hard" }}
  affinity:
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - topologyKey: kubernetes.io/hostname
        labelSelector:
          matchLabels:
            app: alertmanager
            alertmanager: {{ template "prometheus-operator.fullname" . }}-alertmanager
{{- else if eq .Values.alertmanager.alertmanagerSpec.podAntiAffinity "soft" }}
  affinity:
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          topologyKey: kubernetes.io/hostname
          labelSelector:
            matchLabels:
              app: alertmanager
              alertmanager: {{ template "prometheus-operator.fullname" . }}-alertmanager
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.tolerations }}
  tolerations:
{{ toYaml .Values.alertmanager.alertmanagerSpec.tolerations | indent 4 }}
{{- end }}
{{- if .Values.global.imagePullSecrets }}
  imagePullSecrets:
{{ toYaml .Values.global.imagePullSecrets | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.containers }}
  containers:
{{ toYaml .Values.alertmanager.alertmanagerSpec.containers | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.priorityClassName }}
  priorityClassName: {{.Values.alertmanager.alertmanagerSpec.priorityClassName }}
{{- end }}
{{- if .Values.alertmanager.alertmanagerSpec.additionalPeers }}
  additionalPeers: {{.Values.alertmanager.alertmanagerSpec.additionalPeers }}
{{- end }}
{{- end }}