fix(dispatch) fix the sceduler command and add the db init command to the web container

This commit is contained in:
Tommy 2023-12-16 13:41:26 +01:00
parent 16803279d0
commit 1440c726dd
No known key found for this signature in database
6 changed files with 16 additions and 17 deletions

View file

@ -0,0 +1,3 @@
apiVersion: v1
entries: {}
generated: "2023-12-16T11:30:08.388054+01:00"

View file

@ -1,4 +1,4 @@
apiVersion: v2 apiVersion: v2
name: dispatch name: dispatch
description: Netflix Dispatch incident management system description: Netflix Dispatch incident management system
version: 0.1.0 version: 0.1.2

View file

@ -2,7 +2,7 @@ apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "dispatch.fullname" . }}-config name: {{ include "dispatch.fullname" . }}-config
labels:
{{- include "dispatch.labels" . | nindent 4 }}
data: data:
{{- toYaml .Values.configMap.general | nindent 2 }} POSTGRES_HOSTNAME: {{ .Values.postgres.hostname | quote }}
POSTGRES_DATABASE_NAME: {{ .Values.postgres.database_name | quote }}
POSTGRES_PORT: {{ .Values.postgres.port | quote }}

View file

@ -14,6 +14,10 @@ spec:
labels: labels:
app: {{ include "dispatch.fullname" . }}-web app: {{ include "dispatch.fullname" . }}-web
spec: spec:
initContainers:
- name: web-db-init
image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag }}"
command: ["web", "database", "init"]
containers: containers:
- name: web - name: web
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
@ -21,10 +25,6 @@ spec:
command: {{ .Values.web.command }} command: {{ .Values.web.command }}
ports: ports:
- containerPort: {{ .Values.web.container.port }} - containerPort: {{ .Values.web.container.port }}
service:
type: ClusterIP
port: 80
targetPort: 8000
envFrom: envFrom:
- configMapRef: - configMapRef:
name: {{ include "dispatch.fullname" . }}-config name: {{ include "dispatch.fullname" . }}-config

View file

@ -25,15 +25,11 @@ web:
port: 80 port: 80
scheduler: scheduler:
command: ["scheduler", "start"] command: ["dispatch", "scheduler", "start"]
configMap:
general:
COMPOSE_PROJECT_NAME: "dispatch"
DATABASE_HOSTNAME: "postgres-rw.databases.svc.cluster.local"
DATABASE_NAME: "dispatch"
DATABASE_PORT: "5432"
postgres: postgres:
hostname: "postgres-rw.databases.svc.cluster.local"
database_name: "postgres"
port: "5432"
secretRef: secretRef:
name: dispatch-secret name: dispatch-secret

View file

@ -1,3 +1,3 @@
apiVersion: v1 apiVersion: v1
entries: {} entries: {}
generated: "2023-10-26T06:39:11.079729+02:00" generated: "2023-12-16T11:31:03.238235+01:00"