Skip to content

Commit

Permalink
feat: run migrations as init container
Browse files Browse the repository at this point in the history
  • Loading branch information
rochecompaan authored Apr 11, 2023
2 parents 3015bfc + 355e41d commit 7da6182
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions {{cookiecutter.project_slug}}/k8s/django.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,12 @@ spec:
"until pg_isready -h postgres -p 5432;
do echo waiting for postgres; sleep 2; done;",
]
---
apiVersion: batch/v1
kind: Job
metadata:
name: django-migrations-job
spec:
backoffLimit: 10
template:
spec:
containers:
- name: django-migration
image: {{ cookiecutter.project_slug }}_local_django:latest
command: ["python", "manage.py", "migrate"]
envFrom:
- configMapRef:
name: django-config
initContainers:
- name: check-db-ready
image: postgres:12.7
command: [
"sh",
"-c",
"until pg_isready -h postgres -p 5432;
do echo waiting for postgres; sleep 2; done;",
]
restartPolicy: Never
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down

0 comments on commit 7da6182

Please # to comment.