apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "sigi.fullname" . }} labels: {{- include "sigi.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "sigi.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "sigi.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 }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: 80 protocol: TCP env: - name: DATABASE_URL value: {{ printf "postgresql://%s:%s@%s:5432/%s" .Values.postgresql.auth.username .Values.postgresql.auth.password (include "postgresql.fullname" .) .Values.postgresql.auth.database| quote }} - name: ADMIN_PASSWORD value: "{{ .Values.sigi.adminPassword }}" - name: ADMIN_EMAIL value: "{{ .Values.sigi.adminEmail }}" - name: EMAIL_SEND_USER value: "{{ .Values.sigi.emailSendUser }}" - name: DEBUG value: "{{ .Values.sigi.debug }}" - name: USE_TLS value: "{{ .Values.sigi.useTls }}" - name: EMAIL_PORT value: "{{ .Values.sigi.emailPort }}" - name: EMAIL_HOST value: "{{ .Values.sigi.emailHost }}" - name: TZ value: "{{ .Values.sigi.timeZone }}" - name: LANG value: "{{ .Values.sigi.language }}" volumeMounts: # - mountPath: /var/interlegis/sigi/data # name: data - mountPath: /srv/interlegis/sigi/media name: {{ include "sigi.fullname" . }}-media livenessProbe: httpGet: path: / port: http initialDelaySeconds: 60 failureThreshold: 3 periodSeconds: 60 successThreshold: 1 timeoutSeconds: 5 readinessProbe: httpGet: path: / port: http initialDelaySeconds: 60 failureThreshold: 3 periodSeconds: 30 successThreshold: 1 timeoutSeconds: 5 resources: {{- toYaml .Values.resources | nindent 12 }} volumes: # - name: data # secret: # defaultMode: 440 # secretName: {{ include "sigi.fullname" . }}-secretkey - name: {{ include "sigi.fullname" . }}-media {{- if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ include "sigi.fullname" . }}-media {{- else }} emptyDir: {} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} affinity: podAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app.kubernetes.io/name operator: In values: - {{ include "sigi.name" . }} - key: app.kubernetes.io/instance operator: In values: - {{ .Release.Name }} topologyKey: kubernetes.io/hostname - weight: 50 podAffinityTerm: labelSelector: matchExpressions: - key: app.kubernetes.io/name operator: In values: - postgresql - key: app.kubernetes.io/instance operator: In values: - {{ .Release.Name }} topologyKey: kubernetes.io/hostname {{- with .Values.affinity }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}