From cde310d6bc6f04c8e3a72fa22f2328174fdd4034 Mon Sep 17 00:00:00 2001 From: Tommy Date: Sat, 16 Dec 2023 14:59:22 +0100 Subject: [PATCH] feat(dispatch) add enabled flags for the components. Separate secrets so that they can be referenced in each chart. Add a few initial notes. --- charts/dispatch/Chart.yaml | 2 +- charts/dispatch/templates/NOTES.txt | 10 +++++++++- charts/dispatch/templates/configmap.yaml | 8 -------- charts/dispatch/templates/core-deployment.yaml | 6 +++--- .../dispatch/templates/scheduler-deployment.yaml | 6 +++--- charts/dispatch/templates/web-deployment.yaml | 6 +++--- charts/dispatch/values.yaml | 15 +++++++++++---- 7 files changed, 30 insertions(+), 23 deletions(-) delete mode 100644 charts/dispatch/templates/configmap.yaml diff --git a/charts/dispatch/Chart.yaml b/charts/dispatch/Chart.yaml index 78ee8f6..acebc10 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.1.5 \ No newline at end of file +version: 0.1.6 diff --git a/charts/dispatch/templates/NOTES.txt b/charts/dispatch/templates/NOTES.txt index aa4128b..1866a56 100644 --- a/charts/dispatch/templates/NOTES.txt +++ b/charts/dispatch/templates/NOTES.txt @@ -1 +1,9 @@ -NOTES.txt \ No newline at end of file +This is Netflix Dispatch, an unofficial Helm Chart. + +The chart has three components: + +* core: +* scheduler: +* web: + +More info: https://netflix.github.io/dispatch/ \ No newline at end of file diff --git a/charts/dispatch/templates/configmap.yaml b/charts/dispatch/templates/configmap.yaml deleted file mode 100644 index a3b9584..0000000 --- a/charts/dispatch/templates/configmap.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "dispatch.fullname" . }}-config -data: - POSTGRES_HOSTNAME: {{ .Values.postgres.hostname | quote }} - POSTGRES_DATABASE_NAME: {{ .Values.postgres.database_name | quote }} - POSTGRES_PORT: {{ .Values.postgres.port | quote }} \ No newline at end of file diff --git a/charts/dispatch/templates/core-deployment.yaml b/charts/dispatch/templates/core-deployment.yaml index 6238287..c2327c8 100644 --- a/charts/dispatch/templates/core-deployment.yaml +++ b/charts/dispatch/templates/core-deployment.yaml @@ -1,3 +1,4 @@ +{{- if .Values.core.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -26,7 +27,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} command: {{ .Values.core.container.command }} envFrom: - - configMapRef: - name: {{ include "dispatch.fullname" . }}-config - secretRef: - name: {{ .Values.core.secretRef.name }} \ No newline at end of file + name: {{ .Values.core.container.envFrom.secretRef.name }} +{{- end }} \ No newline at end of file diff --git a/charts/dispatch/templates/scheduler-deployment.yaml b/charts/dispatch/templates/scheduler-deployment.yaml index 2e95757..84c19fc 100644 --- a/charts/dispatch/templates/scheduler-deployment.yaml +++ b/charts/dispatch/templates/scheduler-deployment.yaml @@ -1,3 +1,4 @@ +{{- if .Values.scheduler.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -20,7 +21,6 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} command: {{ .Values.scheduler.command }} envFrom: - - configMapRef: - name: {{ include "dispatch.fullname" . }}-config - secretRef: - name: {{ .Values.scheduler.secretRef.name }} \ No newline at end of file + name: {{ .Values.scheduler.container.envFrom.secretRef.name }} +{{- end }} \ No newline at end of file diff --git a/charts/dispatch/templates/web-deployment.yaml b/charts/dispatch/templates/web-deployment.yaml index ad25418..4c46e2a 100644 --- a/charts/dispatch/templates/web-deployment.yaml +++ b/charts/dispatch/templates/web-deployment.yaml @@ -1,3 +1,4 @@ +{{- if .Values.scheduler.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -26,7 +27,6 @@ spec: ports: - containerPort: {{ .Values.web.container.port }} envFrom: - - configMapRef: - name: {{ include "dispatch.fullname" . }}-config - secretRef: - name: {{ .Values.web.secretRef.name }} \ No newline at end of file + name: {{ .Values.web.container.envFrom.secretRef.name }} +{{- end }} \ No newline at end of file diff --git a/charts/dispatch/values.yaml b/charts/dispatch/values.yaml index 79709e9..dfd0d9a 100644 --- a/charts/dispatch/values.yaml +++ b/charts/dispatch/values.yaml @@ -13,23 +13,30 @@ initContainers: name: dispatch-secret core: + enabled: true secretRef: name: dispatch-secret web: + enabled: true container: port: 8000 command: ["dispatch", "server", "start", "dispatch.main:app", "--host=0.0.0.0"] - secretRef: - name: dispatch-secret + envFrom: + secretRef: + name: dispatch-secret service: type: ClusterIP port: 80 scheduler: + enabled: true command: ["dispatch", "scheduler", "start"] - secretRef: - name: dispatch-secret + container: + command: ["dispatch", "scheduler"] + envFrom: + secretRef: + name: dispatch-secret postgres: hostname: "postgres-rw.databases.svc.cluster.local"