apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "listory.fullname" . }} labels: {{- include "listory.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "listory.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "listory.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "listory.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - name: DB_HOST value: {{ .Values.externalDatabase.host }} - name: DB_USERNAME value: {{ .Values.externalDatabase.user }} - name: DB_PASSWORD valueFrom: secretKeyRef: name: {{ include "listory.fullname" . }}-external-db key: postgres-password - name: DB_DATABASE value: {{ .Values.externalDatabase.database }} - name: JWT_SECRET valueFrom: secretKeyRef: name: {{ include "listory.fullname" . }} key: jwt-secret - name: APP_URL value: https://{{ .Values.ingress.host }} - name: SPOTIFY_CLIENT_ID value: {{ .Values.spotify.clientId }} - name: SPOTIFY_CLIENT_SECRET valueFrom: secretKeyRef: name: {{ include "listory.fullname" . }} key: spotify-client-secret - name: SPOTIFY_USER_FILTER value: {{ .Values.spotify.userFilter }} {{- if .Values.sentry.enabled }} - name: SENTRY_ENABLED value: "true" - name: SENTRY_DSN value: {{ .Values.sentry.dsn }} {{- end }} {{- if .Values.prometheus.enabled }} - name: PROMETHEUS_ENABLED value: "true" {{- if .Values.prometheus.basicAuth.enabled }} - name: PROMETHEUS_BASIC_AUTH value: "true" - name: PROMETHEUS_BASIC_AUTH_USERNAME valueFrom: secretKeyRef: name: {{ include "listory.fullname" . }} key: prometheus-basic-auth-username - name: PROMETHEUS_BASIC_AUTH_PASSWORD valueFrom: secretKeyRef: name: {{ include "listory.fullname" . }} key: prometheus-basic-auth-password {{- end }} {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} ports: - name: http containerPort: 3000 protocol: TCP readinessProbe: httpGet: path: /api/v1/health port: http 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 }}