93 lines
3.2 KiB
YAML
93 lines
3.2 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "alertmanager-matrix.fullname" . }}
|
|
labels:
|
|
{{- include "alertmanager-matrix.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
replicas: {{ .Values.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "alertmanager-matrix.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
config-icons: {{ toYaml .Values.bot.icons | sha256sum | trunc 32}}
|
|
config-colors: {{ toYaml .Values.bot.colors | sha256sum | trunc 32}}
|
|
config-templates: {{ toYaml .Values.bot.templates | sha256sum | trunc 32}}
|
|
{{- with .Values.podAnnotations }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "alertmanager-matrix.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "alertmanager-matrix.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
command:
|
|
- "/usr/local/bin/alertmanager_matrix"
|
|
{{- if .Values.bot.showLabels }}
|
|
- "--show-labels"
|
|
{{- end }}
|
|
- "--message-type"
|
|
- {{ .Values.bot.messageType }}
|
|
- "--icon-file"
|
|
- "/config/icon.yaml"
|
|
- "--color-file"
|
|
- "/config/color.yaml"
|
|
- "--text-template"
|
|
- "/config/text.tpl"
|
|
- "--html-template"
|
|
- "/config/html.tpl"
|
|
envFrom:
|
|
- secretRef:
|
|
name: {{ include "alertmanager-matrix.fullname" . }}
|
|
env:
|
|
- name: ADDR
|
|
value: ":{{ .Values.service.port }}"
|
|
- name: HOMESERVER
|
|
value: {{ .Values.bot.matrix.homeserver | quote }}
|
|
{{- with .Values.bot.alertmanager }}
|
|
- name: ALERTMANAGER
|
|
value: {{ . | quote }}
|
|
{{- end }}
|
|
- name: ROOMS
|
|
value: {{ .Values.bot.matrix.rooms | join "," | quote }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.service.port }}
|
|
protocol: TCP
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: "/config"
|
|
readOnly: true
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: config
|
|
configMap:
|
|
name: {{ include "alertmanager-matrix.fullname" . }}
|