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 apiVersion: v2
name: dispatch name: dispatch
description: Netflix Dispatch incident management system description: Netflix Dispatch incident management system
version: 0.5.1 version: 0.5.4
appVersion: v20240605 appVersion: v20240731
maintainers: maintainers:
- name: Tommy Skaug - name: Tommy Skaug
email: tommy@skaug.me email: tommy@skaug.me

View file

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

View file

@ -11,18 +11,21 @@ spec:
template: template:
spec: spec:
restartPolicy: Never restartPolicy: Never
containers:
{{ if ne .Values.image.pullSecret "" }} {{ if ne .Values.image.pullSecret "" }}
imagePullSecrets: imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}" - name: "{{ .Values.image.pullSecret }}"
{{ end }} {{ end }}
containers:
- name: general-db-init - name: general-db-init
image: "{{ .Values.initContainers.dbInit.image.repository }}:{{ .Values.initContainers.dbInit.image.tag }}" image: "{{ .Values.initContainers.dbInit.image.repository }}:{{ .Values.initContainers.dbInit.image.tag }}"
envFrom: envFrom:
- secretRef: - secretRef:
name: {{ .Values.postgres.secretName }} name: {{ .Values.postgres.secretName }}
- name: dispatch-db-init - 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"] command: ["dispatch", "database", "init"]
env: &dispatchEnv env: &dispatchEnv
- name: MJML_PATH - name: MJML_PATH

View file

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

View file

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

View file

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