This commit is contained in:
Vlad Bubnov
2025-05-27 08:03:13 +03:00
parent f47d4feeac
commit fb638f1988
21 changed files with 1639 additions and 68 deletions
+42
View File
@@ -0,0 +1,42 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ .Chart.Name }}-migrate
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
"helm.sh/hook-weight": "10"
spec:
ttlSecondsAfterFinished: 100
template:
spec:
imagePullSecrets:
- name: regsecret
initContainers:
- name: wait-postgres
image: postgres:14-alpine
command:
- bash
- /wait.sh
volumeMounts:
- name: configs
mountPath: /wait.sh
subPath: wait.sh
env:
{{- include "envs_all" . | indent 12 }}
containers:
- name: run-migrations
image: {{ .Values.app.image }}
command: ["php", "yii", "migrate", "--interactive=0"]
env:
{{- include "envs_all" . | indent 12 }}
{{- include "jobs_resources" . | indent 10 }}
volumes:
- name: configs
configMap:
name: job-scripts
defaultMode: 420
restartPolicy: OnFailure
terminationGracePeriodSeconds: 5
backoffLimit: 6