fix(dispatch) correct init command after manual test

This commit is contained in:
Tommy 2023-12-16 19:14:18 +01:00
parent 930313722f
commit a42bb2072d
No known key found for this signature in database
3 changed files with 44 additions and 3 deletions

View file

@ -1,4 +1,4 @@
apiVersion: v2
name: dispatch
description: Netflix Dispatch incident management system
version: 0.2.8
version: 0.2.9

View file

@ -0,0 +1,36 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "dispatch.fullname" . }}-web-db-init
labels:
{{- include "dispatch.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": pre-install
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
spec:
restartPolicy: Never
containers:
- name: general-db-init
image: "{{ .Values.initContainers.dbInit.image.repository }}:{{ .Values.initContainers.dbInit.image.tag }}"
envFrom:
- secretRef:
name: {{ .Values.postgres.secretName }}
- name: dispatch-db-init
image: "{{ .Values.initContainers.dbInit.image.repository }}:{{ .Values.initContainers.dbInit.image.tag }}"
command: ["dispatch", "database", "init"]
env: &dispatchEnv
- name: DISPATCH_UI_URL
value: "{{ .Values.url }}"
- name: DATABASE_HOSTNAME
value: "{{ .Values.postgres.hostname }}"
- name: DATABASE_PORT
value: "{{ .Values.postgres.port }}"
- name: DATABASE_NAME
value: "{{ .Values.postgres.database_name }}"
envFrom:
- secretRef:
name: {{ .Values.envFromSecret }}
# Tolerate a few failures, adjust the number as needed
backoffLimit: 3

View file

@ -16,9 +16,9 @@ spec:
app: {{ include "dispatch.fullname" . }}-web
spec:
initContainers:
- name: web-db-init
- name: web-db-upgrade
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ["dispatch", "database", "init"]
command: ["dispatch", "database", "upgrade"]
env: &dispatchEnv
- name: DISPATCH_UI_URL
value: "{{ .Values.url }}"
@ -31,6 +31,11 @@ spec:
envFrom:
- secretRef:
name: {{ .Values.envFromSecret }}
- name: web-plugin-install
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ["dispatch", "plugins", "install"]
env: *dispatchEnv
containers:
- name: web