apiVersion: apps/v1 {{- $podAnnotations := .Values.podAnnotations }} {{- $secretAnnotation := dict "checksum/secret" (include (print $.Template.BasePath "/secret.yaml") . | sha256sum) }} {{- $podAnnotations := merge $podAnnotations $secretAnnotation }} kind: Deployment metadata: name: {{ include "mautrix-whatsapp.fullname" . }} {{- if .Values.deploymentAnnotations }} annotations: {{- range $key, $value := .Values.deploymentAnnotations }} {{ $key }}: {{ $value | quote }} {{- end }} {{- end }} labels: {{ include "mautrix-whatsapp.labels" . | indent 4 }} spec: replicas: {{ .Values.replicaCount }} {{- if .Values.strategy }} strategy: {{ toYaml .Values.strategy | indent 4 }} {{ if eq .Values.strategy.type "Recreate" }} rollingUpdate: null {{- end }} {{- end }} selector: matchLabels: {{- include "mautrix-whatsapp.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "mautrix-whatsapp.selectorLabels" . | nindent 8 }} {{- if $podAnnotations }} annotations: {{- range $key, $value := $podAnnotations }} {{ $key }}: {{ $value | quote }} {{- end }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ template "mautrix-whatsapp.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} {{- if .Values.dnsConfig }} dnsConfig: {{- toYaml .Values.dnsConfig | nindent 8 }} {{- end }} initContainers: - name: init securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: ["/bin/sh"] args: - "-c" - |- set -ex cp /config/*.yaml /data/ #chown {{.Values.uid}}:{{.Values.gid}} -R /data volumeMounts: - name: data mountPath: /data - name: config mountPath: /config resources: {{- toYaml .Values.resources | nindent 12 }} containers: - name: mautrix-whatsapp securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ required "need config.appservice.port" .Values.config.appservice.port }} protocol: TCP env: [] livenessProbe: httpGet: path: /_matrix/mau/live port: http failureThreshold: {{ .Values.probes.liveness.failureThreshold }} periodSeconds: {{ .Values.probes.liveness.periodSeconds }} readinessProbe: httpGet: path: /_matrix/mau/live port: http failureThreshold: {{ .Values.probes.readiness.failureThreshold }} periodSeconds: {{ .Values.probes.readiness.periodSeconds }} {{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }} startupProbe: httpGet: path: /_matrix/mau/live port: http initialDelaySeconds: {{ .Values.probes.startup.initialDelaySeconds }} failureThreshold: {{ .Values.probes.startup.failureThreshold }} periodSeconds: {{ .Values.probes.startup.periodSeconds }} {{- end }} volumeMounts: - name: data mountPath: /data - name: config mountPath: /config resources: {{- toYaml .Values.resources | nindent 12 }} volumes: - name: config secret: secretName: {{ include "mautrix-whatsapp.fullname" . }} - name: data {{- if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ .Values.persistence.existingClaim | default (include "mautrix-whatsapp.fullname" .) }} {{- else }} emptyDir: {} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}