mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
Move helm database migrations to Job
This commit is contained in:
30
kube/boost/templates/migration-job.yaml
Normal file
30
kube/boost/templates/migration-job.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: database-migrations-job
|
||||
labels:
|
||||
env: {{ .Values.deploymentEnvironment }}
|
||||
app: boost
|
||||
annotations:
|
||||
"helm.sh/hook": pre-install,pre-upgrade
|
||||
"helm.sh/hook-weight": "-1"
|
||||
spec:
|
||||
ttlSecondsAfterFinished: 3600
|
||||
backoffLimit: 4
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
volumes:
|
||||
{{ toYaml .Values.Volumes | indent 6 }}
|
||||
imagePullSecrets:
|
||||
- name: revsys-docker-registry
|
||||
containers:
|
||||
- name: database-migrations
|
||||
image: {{ .Values.Image }}:{{ .Values.ImageTag }}
|
||||
command: ["/bin/sh", "-c"]
|
||||
args:
|
||||
- "./manage.py migrate --noinput"
|
||||
env:
|
||||
{{ toYaml .Values.Env | indent 10 }}
|
||||
volumeMounts:
|
||||
{{ toYaml .Values.VolumeMounts | indent 10 }}
|
||||
@@ -15,8 +15,9 @@ replicaCount: "2"
|
||||
# where necessary
|
||||
|
||||
initCommands:
|
||||
- name: migrate
|
||||
command: ./manage.py migrate --noinput
|
||||
# migrate moved to a Job
|
||||
# - name: migrate
|
||||
# command: ./manage.py migrate --noinput
|
||||
- name: collectstatic
|
||||
command: ./manage.py collectstatic --noinput
|
||||
|
||||
|
||||
Reference in New Issue
Block a user