github.com/microsoft/fabrikate@v1.0.0-alpha.1.0.20210115014322-dc09194d0885/testdata/local-charts/prometheus/templates/alertmanager/deploy.yaml (about) 1 {{- if and .Values.alertmanager.enabled (not .Values.alertmanager.statefulSet.enabled) -}} 2 apiVersion: {{ template "prometheus.deployment.apiVersion" . }} 3 kind: Deployment 4 metadata: 5 {{- if .Values.alertmanager.deploymentAnnotations }} 6 annotations: 7 {{ toYaml .Values.alertmanager.deploymentAnnotations | nindent 4 }} 8 {{- end }} 9 labels: 10 {{- include "prometheus.alertmanager.labels" . | nindent 4 }} 11 name: {{ template "prometheus.alertmanager.fullname" . }} 12 {{ include "prometheus.namespace" . | indent 2 }} 13 spec: 14 selector: 15 matchLabels: 16 {{- include "prometheus.alertmanager.matchLabels" . | nindent 6 }} 17 replicas: {{ .Values.alertmanager.replicaCount }} 18 {{- if .Values.alertmanager.strategy }} 19 strategy: 20 {{ toYaml .Values.alertmanager.strategy | trim | indent 4 }} 21 {{ if eq .Values.alertmanager.strategy.type "Recreate" }}rollingUpdate: null{{ end }} 22 {{- end }} 23 template: 24 metadata: 25 {{- if .Values.alertmanager.podAnnotations }} 26 annotations: 27 {{ toYaml .Values.alertmanager.podAnnotations | nindent 8 }} 28 {{- end }} 29 labels: 30 {{- include "prometheus.alertmanager.labels" . | nindent 8 }} 31 {{- if .Values.alertmanager.podLabels}} 32 {{ toYaml .Values.alertmanager.podLabels | nindent 8 }} 33 {{- end}} 34 spec: 35 {{- if .Values.alertmanager.schedulerName }} 36 schedulerName: "{{ .Values.alertmanager.schedulerName }}" 37 {{- end }} 38 serviceAccountName: {{ template "prometheus.serviceAccountName.alertmanager" . }} 39 {{- if .Values.alertmanager.extraInitContainers }} 40 initContainers: 41 {{ toYaml .Values.alertmanager.extraInitContainers | indent 8 }} 42 {{- end }} 43 {{- if .Values.alertmanager.priorityClassName }} 44 priorityClassName: "{{ .Values.alertmanager.priorityClassName }}" 45 {{- end }} 46 containers: 47 - name: {{ template "prometheus.name" . }}-{{ .Values.alertmanager.name }} 48 image: "{{ .Values.alertmanager.image.repository }}:{{ .Values.alertmanager.image.tag }}" 49 imagePullPolicy: "{{ .Values.alertmanager.image.pullPolicy }}" 50 env: 51 {{- range $key, $value := .Values.alertmanager.extraEnv }} 52 - name: {{ $key }} 53 value: {{ $value }} 54 {{- end }} 55 - name: POD_IP 56 valueFrom: 57 fieldRef: 58 apiVersion: v1 59 fieldPath: status.podIP 60 args: 61 - --config.file=/etc/config/{{ .Values.alertmanager.configFileName }} 62 - --storage.path={{ .Values.alertmanager.persistentVolume.mountPath }} 63 - --cluster.advertise-address=$(POD_IP):6783 64 {{- range $key, $value := .Values.alertmanager.extraArgs }} 65 - --{{ $key }}={{ $value }} 66 {{- end }} 67 {{- if .Values.alertmanager.baseURL }} 68 - --web.external-url={{ .Values.alertmanager.baseURL }} 69 {{- end }} 70 71 ports: 72 - containerPort: 9093 73 readinessProbe: 74 httpGet: 75 path: {{ .Values.alertmanager.prefixURL }}/-/ready 76 port: 9093 77 initialDelaySeconds: 30 78 timeoutSeconds: 30 79 resources: 80 {{ toYaml .Values.alertmanager.resources | indent 12 }} 81 volumeMounts: 82 - name: config-volume 83 mountPath: /etc/config 84 - name: storage-volume 85 mountPath: "{{ .Values.alertmanager.persistentVolume.mountPath }}" 86 subPath: "{{ .Values.alertmanager.persistentVolume.subPath }}" 87 {{- range .Values.alertmanager.extraSecretMounts }} 88 - name: {{ .name }} 89 mountPath: {{ .mountPath }} 90 subPath: {{ .subPath }} 91 readOnly: {{ .readOnly }} 92 {{- end }} 93 94 {{- if .Values.configmapReload.alertmanager.enabled }} 95 - name: {{ template "prometheus.name" . }}-{{ .Values.alertmanager.name }}-{{ .Values.configmapReload.alertmanager.name }} 96 image: "{{ .Values.configmapReload.alertmanager.image.repository }}:{{ .Values.configmapReload.alertmanager.image.tag }}" 97 imagePullPolicy: "{{ .Values.configmapReload.alertmanager.image.pullPolicy }}" 98 args: 99 - --volume-dir=/etc/config 100 - --webhook-url=http://127.0.0.1:9093{{ .Values.alertmanager.prefixURL }}/-/reload 101 resources: 102 {{ toYaml .Values.configmapReload.alertmanager.resources | indent 12 }} 103 volumeMounts: 104 - name: config-volume 105 mountPath: /etc/config 106 readOnly: true 107 {{- end }} 108 {{- if .Values.imagePullSecrets }} 109 imagePullSecrets: 110 {{ toYaml .Values.imagePullSecrets | indent 2 }} 111 {{- end }} 112 {{- if .Values.alertmanager.nodeSelector }} 113 nodeSelector: 114 {{ toYaml .Values.alertmanager.nodeSelector | indent 8 }} 115 {{- end }} 116 {{- if .Values.alertmanager.securityContext }} 117 securityContext: 118 {{ toYaml .Values.alertmanager.securityContext | indent 8 }} 119 {{- end }} 120 {{- if .Values.alertmanager.tolerations }} 121 tolerations: 122 {{ toYaml .Values.alertmanager.tolerations | indent 8 }} 123 {{- end }} 124 {{- if .Values.alertmanager.affinity }} 125 affinity: 126 {{ toYaml .Values.alertmanager.affinity | indent 8 }} 127 {{- end }} 128 volumes: 129 - name: config-volume 130 {{- if empty .Values.alertmanager.configFromSecret }} 131 configMap: 132 name: {{ if .Values.alertmanager.configMapOverrideName }}{{ .Release.Name }}-{{ .Values.alertmanager.configMapOverrideName }}{{- else }}{{ template "prometheus.alertmanager.fullname" . }}{{- end }} 133 {{- else }} 134 secret: 135 secretName: {{ .Values.alertmanager.configFromSecret }} 136 {{- end }} 137 {{- range .Values.alertmanager.extraSecretMounts }} 138 - name: {{ .name }} 139 secret: 140 secretName: {{ .secretName }} 141 {{- end }} 142 - name: storage-volume 143 {{- if .Values.alertmanager.persistentVolume.enabled }} 144 persistentVolumeClaim: 145 claimName: {{ if .Values.alertmanager.persistentVolume.existingClaim }}{{ .Values.alertmanager.persistentVolume.existingClaim }}{{- else }}{{ template "prometheus.alertmanager.fullname" . }}{{- end }} 146 {{- else }} 147 emptyDir: 148 {{- if .Values.alertmanager.emptyDir.sizeLimit }} 149 sizeLimit: {{ .Values.alertmanager.emptyDir.sizeLimit }} 150 {{- else }} 151 {} 152 {{- end -}} 153 {{- end -}} 154 {{- end }}