apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "ntfy.fullname" . }} labels: {{- include "ntfy.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "ntfy.selectorLabels" . | nindent 6 }} template: metadata: annotations: confighash: {{ .Values.ntfy | toYaml | sha256sum | trunc 32 }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "ntfy.selectorLabels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "ntfy.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: [ "serve" ] envFrom: - configMapRef: name: {{ include "ntfy.fullname" . }}-env ports: - name: http containerPort: {{ .Values.service.http.port }} protocol: TCP {{- if .Values.ntfy.metrics.enable }} - name: metrics containerPort: {{ .Values.ntfy.metrics.port }} protocol: TCP {{- end }} - name: smtp containerPort: {{ .Values.service.smtp.port }} protocol: TCP livenessProbe: httpGet: path: /v1/health port: http readinessProbe: httpGet: path: /v1/health port: http resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - name: "data" mountPath: "/data" volumes: - name: "data" {{- if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "ntfy.fullname" . }}{{- end }} {{- 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 }}