Skip to content

Commit

Permalink
Fixup initContainer to run migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
chosak committed Nov 25, 2024
1 parent c6eda3e commit 884d50c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
28 changes: 14 additions & 14 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
initContainers:
{{- range .Values.initContainers }}
- name: {{ .name }}
image: "{{.image.repository}}:{{ .image.tag}}"
Expand All @@ -34,10 +34,10 @@ spec:
- name: http
containerPort: {{ .port }}
protocol: TCP
{{ if .commands }}
commands:
{{- range .commands }}
- "{{ . }}"
{{- if .command }}
command:
{{- range .command }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{ if .args }}
Expand All @@ -47,17 +47,17 @@ spec:
{{- end }}
{{- end }}
envFrom:
- configMapRef:
- configMapRef:
name: {{ $.Release.Name }}-configmap
{{ if .env}}
env:
env:
{{- range .env }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
{{- end }}
{{- end }}
containers:
containers:
{{- range .Values.containers }}
- name: {{ .name }}
image: "{{.image.repository}}:{{ .image.tag}}"
Expand All @@ -66,10 +66,10 @@ spec:
- name: http
containerPort: {{ .port }}
protocol: TCP
{{ if .commands }}
commands:
{{- range .commands }}
- "{{ . }}"
{{- if .command }}
command:
{{- range .command }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{ if .args }}
Expand All @@ -80,9 +80,9 @@ spec:
{{- end }}
{{ if .env}}
envFrom:
- configMapRef:
- configMapRef:
name: {{ $.Release.Name }}-configmap
env:
env:
{{- range .env }}
- name: {{ .name }}
value: {{ .value | quote }}
Expand Down
11 changes: 2 additions & 9 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ initContainers:
pullPolicy: IfNotPresent
tag: "latest"
port: 8000
env:
- name: DJANGO_SETTINGS_MODULE
value: "django_application.settings.helm_eks"
commands: ["sh", "-c"]
command: ["sh", "-c"]
args:
- |
python friendly-umbrella/manage.py makemigrations && python friendly-umbrella/manage.py migrate
- python manage.py migrate

containers:
- name: friendly-umbrella
Expand All @@ -22,9 +18,6 @@ containers:
pullPolicy: IfNotPresent
tag: "latest"
port: 8000
env:
- name: DJANGO_SETTINGS_MODULE
value: "django_application.settings.helm_eks"

image:
repository: friendly-umbrella
Expand Down

0 comments on commit 884d50c

Please sign in to comment.