From c066b695cd6801454636c34e4ead58ddfa4f91d2 Mon Sep 17 00:00:00 2001 From: Tommy Date: Sat, 16 Dec 2023 16:49:16 +0100 Subject: [PATCH] chore(dispatch) restructuring values --- charts/dispatch/Chart.yaml | 2 +- .../dispatch/templates/core-deployment.yaml | 11 ++++++-- .../templates/scheduler-deployment.yaml | 12 +++++++-- charts/dispatch/templates/web-deployment.yaml | 15 ++++++++--- charts/dispatch/templates/web-service.yaml | 2 +- charts/dispatch/values.yaml | 25 ++++++------------- 6 files changed, 41 insertions(+), 26 deletions(-) diff --git a/charts/dispatch/Chart.yaml b/charts/dispatch/Chart.yaml index 30f3144..ac89391 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.1 +version: 0.2.2 \ No newline at end of file diff --git a/charts/dispatch/templates/core-deployment.yaml b/charts/dispatch/templates/core-deployment.yaml index 23ff6e8..59e9ebc 100644 --- a/charts/dispatch/templates/core-deployment.yaml +++ b/charts/dispatch/templates/core-deployment.yaml @@ -25,8 +25,15 @@ spec: - name: core image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - command: {{ .Values.core.container.command }} - env: {{ .Values.core.container.env }} + env: + - 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 }} diff --git a/charts/dispatch/templates/scheduler-deployment.yaml b/charts/dispatch/templates/scheduler-deployment.yaml index 2a7c2dc..eacb93e 100644 --- a/charts/dispatch/templates/scheduler-deployment.yaml +++ b/charts/dispatch/templates/scheduler-deployment.yaml @@ -19,8 +19,16 @@ spec: - name: scheduler image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - command: {{ .Values.scheduler.container.command }} - env: {{ .Values.scheduler.container.env }} + command: ["dispatch", "scheduler", "start"] + env: + - 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 }} diff --git a/charts/dispatch/templates/web-deployment.yaml b/charts/dispatch/templates/web-deployment.yaml index d43b151..887af27 100644 --- a/charts/dispatch/templates/web-deployment.yaml +++ b/charts/dispatch/templates/web-deployment.yaml @@ -19,14 +19,23 @@ spec: - name: web-db-init image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" command: ["dispatch", "web", "database", "init"] + containers: - name: web image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - command: {{ .Values.web.container.command }} + command: ["dispatch", "server", "start", "dispatch.main:app", "--host=0.0.0.0"] ports: - - containerPort: {{ .Values.web.container.port }} - env: {{ .Values.web.container.env }} + - containerPort: 8000 + env: + - 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 }} diff --git a/charts/dispatch/templates/web-service.yaml b/charts/dispatch/templates/web-service.yaml index 508a8cb..652df15 100644 --- a/charts/dispatch/templates/web-service.yaml +++ b/charts/dispatch/templates/web-service.yaml @@ -8,7 +8,7 @@ spec: type: {{ .Values.web.service.type }} ports: - port: {{ .Values.web.service.port }} - targetPort: {{ .Values.web.container.port }} + targetPort: 8000 protocol: TCP selector: app: {{ include "dispatch.fullname" . }}-web diff --git a/charts/dispatch/values.yaml b/charts/dispatch/values.yaml index 59c14e9..6f1c801 100644 --- a/charts/dispatch/values.yaml +++ b/charts/dispatch/values.yaml @@ -1,4 +1,4 @@ -envFromSecret: dispatch-secret +envFromSecret: *secret dispatch-secret image: repository: ghcr.io/tommy-skaug/dispatch @@ -12,34 +12,25 @@ initContainers: tag: "16" envFrom: - secretRef: - name: dispatch-secret + name: &secret + +url: http://localhost:80 core: enabled: true - container: - env: [] - web: enabled: true - container: - port: 8000 - command: ["dispatch", "server", "start", "dispatch.main:app", "--host=0.0.0.0"] - env: [] - service: type: ClusterIP port: 80 scheduler: enabled: true - container: - command: ["dispatch", "scheduler", "start"] - env: [] postgres: - hostname: "postgres-rw.databases.svc.cluster.local" - database_name: "postgres" - port: "5432" + hostname: "postgres-rw.databases.svc.cluster.local" + database_name: "dispatch" + port: "5432" secretRef: - name: dispatch-secret \ No newline at end of file + name: &secret \ No newline at end of file