refactor(deploy): mount database_url.txt as file and run migrate command in shell under /bin/ash -c
This commit is contained in:
parent
11cc2027b8
commit
0904448966
1 changed files with 13 additions and 8 deletions
|
|
@ -25,17 +25,22 @@ spec:
|
||||||
containers:
|
containers:
|
||||||
- name: migrations
|
- name: migrations
|
||||||
image: "{{ .Values.migrations.image.repository }}:{{ .Values.migrations.image.tag }}"
|
image: "{{ .Values.migrations.image.repository }}:{{ .Values.migrations.image.tag }}"
|
||||||
command: ["/usr/local/bin/migrate"]
|
command: ["/bin/ash"]
|
||||||
args: ["-path", "/srv/migrations/", "-database", "$MIGRATE_DATABASE_URL", "up"]
|
args:
|
||||||
env:
|
- -c
|
||||||
- name: MIGRATE_DATABASE_URL
|
- |
|
||||||
valueFrom:
|
migrate -path /srv/migrations -database $(cat /etc/yggdrasil/secrets/database_url.txt) up
|
||||||
secretKeyRef:
|
|
||||||
name: {{ .Release.Name }}
|
|
||||||
key: "database_url.txt"
|
|
||||||
{{- with .Values.migrations.resources }}
|
{{- with .Values.migrations.resources }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /etc/yggdrasil/secrets
|
||||||
|
name: secrets
|
||||||
|
readOnly: true
|
||||||
|
volumes:
|
||||||
|
- name: secrets
|
||||||
|
secret:
|
||||||
|
secretName: {{ .Release.Name }}
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
backoffLimit: 0
|
backoffLimit: 0
|
||||||
|
|
|
||||||
Reference in a new issue