@@ -2,22 +2,28 @@ apiVersion: apps/v1
22kind : Deployment
33metadata :
44 name : {{ include "codexdocs.fullname" . }}
5+ {{- with .Values.annotations }}
6+ annotations :
7+ {{- toYaml . | nindent 4 }}
8+ {{- end }}
59 labels :
610 {{- include "codexdocs.labels" . | nindent 4 }}
711spec :
8- {{/* {{- if not .Values.autoscaling.enabled }}*/}}
9- {{/* replicas: {{ .Values.replicaCount }}*/}}
10- {{/* {{- end }}*/}}
12+ {{- if or (eq .Values.configuration.database.driver "local") (eq .Values.configuration.uploads.driver "local")}}
1113 replicas : 1
1214 strategy :
1315 type : Recreate
16+ {{- else }}
17+ replicas : {{ .Values.replicaCount }}
18+ {{- end }}
1419 selector :
1520 matchLabels :
1621 {{- include "codexdocs.selectorLabels" . | nindent 6 }}
1722 template :
1823 metadata :
19- {{- with .Values.podAnnotations }}
2024 annotations :
25+ checksum/config : {{ .Values.configuration | toString | sha256sum }}
26+ {{- with .Values.podAnnotations }}
2127 {{- toYaml . | nindent 8 }}
2228 {{- end }}
2329 labels :
@@ -34,35 +40,43 @@ spec:
3440 configMap :
3541 defaultMode : 420
3642 name : {{ .Release.Name }}-config
43+ {{- if eq .Values.configuration.database.driver "local" }}
3744 - name : {{ include "codexdocs.fullname" . }}-db
3845 persistentVolumeClaim :
3946 claimName : {{ include "codexdocs.fullname" . }}-db
47+ {{- end }}
48+ {{- if eq .Values.configuration.uploads.driver "local" }}
4049 - name : {{ include "codexdocs.fullname" . }}-uploads
4150 persistentVolumeClaim :
4251 claimName : {{ include "codexdocs.fullname" . }}-uploads
52+ {{- end }}
4353 containers :
4454 - name : {{ .Chart.Name }}
4555 securityContext :
4656 {{- toYaml .Values.securityContext | nindent 12 }}
4757 image : " {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4858 imagePullPolicy : {{ .Values.image.pullPolicy }}
4959 env :
50- - name : PASSWORD
60+ - name : APP_CONFIG_auth_password
5161 valueFrom :
5262 secretKeyRef :
5363 name : {{ template "codexdocs.secretName" . }}
5464 key : {{ template "codexdocs.secretPasswordKey" . }}
65+ {{- if .Values.env }}
66+ {{ toYaml .Values.env | indent 12 }}
67+ {{- end }}
5568 volumeMounts :
5669 - name : config
57- mountPath : /usr/src/app/.codexdocsrc
58- subPath : " codexdocsrc"
59- - name : config
60- mountPath : /usr/src/app/config/production.json
61- subPath : " production.json"
70+ mountPath : /usr/src/app/docs-config.yaml
71+ subPath : " docs-config.yaml"
72+ {{- if eq .Values.configuration.database.driver "local" }}
6273 - name : {{ include "codexdocs.fullname" . }}-db
63- mountPath : {{ .Values.configuration.production.database }}
74+ mountPath : {{ .Values.configuration.database.local.path }}
75+ {{- end}}
76+ {{- if eq .Values.configuration.uploads.driver "local" }}
6477 - name : {{ include "codexdocs.fullname" . }}-uploads
65- mountPath : {{ .Values.configuration.production.uploads }}
78+ mountPath : {{ .Values.configuration.uploads.local.path }}
79+ {{- end}}
6680 ports :
6781 - name : http
6882 containerPort : 3000
0 commit comments