Skip to content

Commit

Permalink
ADD k8s startup visual regen on chart upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
wabscale committed Feb 18, 2022
1 parent 03c8354 commit 0490b66
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 22 deletions.
22 changes: 0 additions & 22 deletions k8s/chart/templates/migrate.yml

This file was deleted.

46 changes: 46 additions & 0 deletions k8s/chart/templates/startup-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: db-migrate-{{ .Release.Revision }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "chart.labels" . | nindent 4 }}
component: db-migrate
spec:
backoffLimit: 4
ttlSecondsAfterFinished: 30
template:
spec:
restartPolicy: Never
containers:
- name: db-migrate
image: {{ .Values.api.image }}:{{ .Values.api.tag }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: ["alembic", "upgrade", "head"]
env:
{{- include "api.env" . | nindent 12 }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: db-visuals-{{ .Release.Revision }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "chart.labels" . | nindent 4 }}
component: visuals
spec:
backoffLimit: 4
ttlSecondsAfterFinished: 30
template:
spec:
restartPolicy: Never
containers:
- name: visuals
image: {{ .Values.api.image }}:{{ .Values.api.tag }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: [ "python3", "jobs/visuals.py" ]
env:
- name: "JOB"
value: "1"
{{- include "api.env" . | nindent 12 }}

0 comments on commit 0490b66

Please sign in to comment.