fix(dispatch): tweaks to get initial deployment working

This commit is contained in:
Tommy 2024-09-25 17:45:11 +02:00
parent b7d1072ff2
commit 67ba9898b9
Signed by: tommy
SSH key fingerprint: SHA256:1LWgQT3QPHIT29plS8jjXc3S1FcE/4oGvsx3Efxs6Uc
6 changed files with 48 additions and 31 deletions

View file

@ -1,8 +1,8 @@
apiVersion: v2
name: dispatch
description: Netflix Dispatch incident management system
version: 0.5.1
appVersion: v20240605
version: 0.5.4
appVersion: v20240731
maintainers:
- name: Tommy Skaug
email: tommy@skaug.me

View file

@ -17,18 +17,20 @@ spec:
spec:
initContainers:
- name: db-init
image: "{{ .Values.initContainers.dbInit.image.repository }}:{{ .Values.initContainers.dbInit.image.tag }}"
image: "{{ .Values.initContainers.dbInit.image.registry }}:{{ .Values.initContainers.dbInit.image.tag }}"
envFrom:
- secretRef:
name: {{ .Values.postgres.secretName }}
{{ if ne .Values.image.pullSecret "" }}
imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}"
{{ end }}
containers:
{{ if ne .Values.image.pullSecret "" }}
imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}"
{{ end }}
- name: core
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.image }}
image: "{{ coalesce $.Values.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ coalesce $.Values.image.pullPolicy .pullPolicy }}
{{- end }}
env:
- name: MJML_PATH
value: /node_modules/.bin

View file

@ -11,18 +11,21 @@ spec:
template:
spec:
restartPolicy: Never
{{ if ne .Values.image.pullSecret "" }}
imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}"
{{ end }}
containers:
{{ if ne .Values.image.pullSecret "" }}
imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}"
{{ end }}
- 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 }}"
{{- with .Values.image }}
image: "{{ coalesce $.Values.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ coalesce $.Values.image.pullPolicy .pullPolicy }}
{{- end }}
command: ["dispatch", "database", "init"]
env: &dispatchEnv
- name: MJML_PATH

View file

@ -15,14 +15,16 @@ spec:
labels:
app: {{ include "dispatch.fullname" . }}-scheduler
spec:
{{ if ne .Values.image.pullSecret "" }}
imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}"
{{ end }}
containers:
{{ if ne .Values.image.pullSecret "" }}
imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}"
{{ end }}
- name: scheduler
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.image }}
image: "{{ coalesce $.Values.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ coalesce $.Values.image.pullPolicy .pullPolicy }}
{{- end }}
command: ["dispatch", "scheduler", "start"]
env:
- name: MJML_PATH

View file

@ -17,7 +17,10 @@ spec:
spec:
initContainers:
- name: web-db-upgrade
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
{{- with .Values.image }}
image: "{{ coalesce $.Values.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ coalesce $.Values.image.pullPolicy .pullPolicy }}
{{- end }}
command: ["dispatch", "database", "upgrade"]
env: &dispatchEnv
- name: MJML_PATH
@ -41,19 +44,24 @@ spec:
name: {{ .Values.envFromSecret }}
- name: web-plugin-install
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
{{- with .Values.image }}
image: "{{ coalesce $.Values.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ coalesce $.Values.image.pullPolicy .pullPolicy }}
{{- end }}
command: ["dispatch", "plugins", "install"]
env: *dispatchEnv
envFrom: *envFrom
{{ if ne .Values.image.pullSecret "" }}
imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}"
{{ end }}
containers:
{{ if ne .Values.image.pullSecret "" }}
imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}"
{{ end }}
- name: web
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.image }}
image: "{{ coalesce $.Values.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ coalesce $.Values.image.pullPolicy .pullPolicy }}
{{- end }}
command: ["dispatch", "server", "start", "dispatch.main:app", "--host=0.0.0.0"]
ports:
- containerPort: 8000

View file

@ -1,9 +1,11 @@
envFromSecret: dispatch-secret
image:
repository: ghcr.io/tommy-skaug/dispatch
pullPolicy: Always
pullSecret: dispatch-pull-secret
registry: code.252.no
repository: elk-works/dispatch
tag: v20240731@sha256:e6c916d8bb6e02e7e23473229f3aa7643bcd00de5f59553794573a4a4737a635
pullPolicy: IfNotPresent
pullSecret: ""
initContainers:
dbInit: