apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "healthchecks.fullname" . }} labels: {{- include "healthchecks.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "healthchecks.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "healthchecks.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ default "latest" .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} envFrom: - configMapRef: name: {{ include "healthchecks.fullname" . }} optional: true env: {{- if .Values.existingSecret }} - name: DB_PASSWORD valueFrom: secretKeyRef: name: {{ default .Values.existingSecret }} key: postgresql-password - name: EMAIL_HOST_PASSWORD valueFrom: secretKeyRef: name: {{ .Values.existingSecret }} key: email-host-password - name: SUPERUSER_EMAIL valueFrom: secretKeyRef: name: {{ .Values.existingSecret }} key: superuser-email - name: SUPERUSER_PASSWORD valueFrom: secretKeyRef: name: {{ .Values.existingSecret }} key: superuser-password {{- else }} - name: DB_PASSWORD value: "healthchecks" - name: EMAIL_HOST_PASSWORD value: "healthchecks" - name: SUPERUSER_EMAIL value: "admin@healthchecks.com" - name: SUPERUSER_PASSWORD value: "healthchecks" {{- end }} ports: - name: http containerPort: 8000 protocol: TCP {{- if .Values.probs }} {{ toYaml .Values.probs | indent 10 }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}