apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "factorio-dashboard.fullname" . }} labels: {{- include "factorio-dashboard.labels" . | nindent 4 }} spec: replicas: {{ .Values.app.replicaCount }} selector: matchLabels: {{- include "factorio-dashboard.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "factorio-dashboard.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} initContainers: - name: migrate image: {{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy }} command: ["npm", "run", "migrate"] env: - name: DATABASE_URL valueFrom: secretKeyRef: name: {{ include "factorio-dashboard.secretName" . }} key: DATABASE_URL containers: - name: app image: {{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 3000 env: - name: API_TOKEN valueFrom: secretKeyRef: name: {{ include "factorio-dashboard.secretName" . }} key: API_TOKEN - name: DATABASE_URL valueFrom: secretKeyRef: name: {{ include "factorio-dashboard.secretName" . }} key: DATABASE_URL readinessProbe: httpGet: path: / port: 3000 initialDelaySeconds: 5 periodSeconds: 10 {{- with .Values.resources }} resources: {{- toYaml . | nindent 12 }} {{- 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 }}