diff --git a/charts/dispatch/Chart.yaml b/charts/dispatch/Chart.yaml index 3071008..33c5add 100644 --- a/charts/dispatch/Chart.yaml +++ b/charts/dispatch/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v2 name: dispatch description: Netflix Dispatch incident management system -version: 0.2.8 \ No newline at end of file +version: 0.2.9 \ No newline at end of file diff --git a/charts/dispatch/templates/dispatch-db-init.yaml b/charts/dispatch/templates/dispatch-db-init.yaml new file mode 100644 index 0000000..4b97531 --- /dev/null +++ b/charts/dispatch/templates/dispatch-db-init.yaml @@ -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 \ No newline at end of file diff --git a/charts/dispatch/templates/web-deployment.yaml b/charts/dispatch/templates/web-deployment.yaml index 15c0320..b53dd4b 100644 --- a/charts/dispatch/templates/web-deployment.yaml +++ b/charts/dispatch/templates/web-deployment.yaml @@ -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