feat(dispatch) add support for Netflix Dispatch
This commit is contained in:
parent
744c654213
commit
bb50fc9fde
9 changed files with 186 additions and 0 deletions
4
charts/dispatch/Chart.yaml
Normal file
4
charts/dispatch/Chart.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v2
|
||||
name: dispatch
|
||||
description: Netflix Dispatch incident management system
|
||||
version: 0.1.0
|
1
charts/dispatch/templates/NOTES.txt
Normal file
1
charts/dispatch/templates/NOTES.txt
Normal file
|
@ -0,0 +1 @@
|
|||
NOTES.txt
|
30
charts/dispatch/templates/_helpers.tpl
Normal file
30
charts/dispatch/templates/_helpers.tpl
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Define a template for the chart's full name.
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "dispatch.fullname" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end }}
|
||||
|
||||
# Define a template for standard labels.
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "dispatch.labels" -}}
|
||||
helm.sh/chart: {{ include "dispatch.chart" . }}
|
||||
app.kubernetes.io/name: {{ include "dispatch.fullname" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/version: {{ .Chart.Version | quote }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
# Define a template for the chart name and version.
|
||||
{{/*
|
||||
Generate basic labels
|
||||
*/}}
|
||||
{{- define "dispatch.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" -}}
|
||||
{{- end }}
|
||||
|
||||
# Optionally, add more helper templates as needed.
|
8
charts/dispatch/templates/configmap.yaml
Normal file
8
charts/dispatch/templates/configmap.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "dispatch.fullname" . }}-config
|
||||
labels:
|
||||
{{- include "dispatch.labels" . | nindent 4 }}
|
||||
data:
|
||||
{{- toYaml .Values.configMap.general | nindent 2 }}
|
32
charts/dispatch/templates/core-deployment.yaml
Normal file
32
charts/dispatch/templates/core-deployment.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "dispatch.fullname" . }}-core
|
||||
labels:
|
||||
{{- include "dispatch.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ include "dispatch.fullname" . }}-core
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ include "dispatch.fullname" . }}-core
|
||||
spec:
|
||||
initContainers:
|
||||
- name: db-init
|
||||
image: "{{ .Values.initContainers.dbInit.image.repository }}:{{ .Values.initContainers.dbInit.image.tag }}"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ .Values.postgres.secretRef.name }}
|
||||
containers:
|
||||
- name: core
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
command: {{ .Values.core.container.command }}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "dispatch.fullname" . }}-config
|
||||
- secretRef:
|
||||
name: {{ .Values.postgres.secretRef.name }}
|
26
charts/dispatch/templates/scheduler-deployment.yaml
Normal file
26
charts/dispatch/templates/scheduler-deployment.yaml
Normal file
|
@ -0,0 +1,26 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "dispatch.fullname" . }}-scheduler
|
||||
labels:
|
||||
{{- include "dispatch.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ include "dispatch.fullname" . }}-scheduler
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ include "dispatch.fullname" . }}-scheduler
|
||||
spec:
|
||||
containers:
|
||||
- name: scheduler
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
command: {{ .Values.scheduler.command }}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "dispatch.fullname" . }}-config
|
||||
- secretRef:
|
||||
name: {{ .Values.postgres.secretRef.name }}
|
32
charts/dispatch/templates/web-deployment.yaml
Normal file
32
charts/dispatch/templates/web-deployment.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "dispatch.fullname" . }}-web
|
||||
labels:
|
||||
{{- include "dispatch.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ include "dispatch.fullname" . }}-web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ include "dispatch.fullname" . }}-web
|
||||
spec:
|
||||
containers:
|
||||
- name: web
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
command: {{ .Values.web.command }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.web.container.port }}
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
targetPort: 8000
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "dispatch.fullname" . }}-config
|
||||
- secretRef:
|
||||
name: {{ .Values.postgres.secretRef.name }}
|
14
charts/dispatch/templates/web-service.yaml
Normal file
14
charts/dispatch/templates/web-service.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "dispatch.fullname" . }}-web
|
||||
labels:
|
||||
{{- include "dispatch.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.web.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.web.service.port }}
|
||||
targetPort: {{ .Values.web.container.port }}
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: {{ include "dispatch.fullname" . }}-web
|
39
charts/dispatch/values.yaml
Normal file
39
charts/dispatch/values.yaml
Normal file
|
@ -0,0 +1,39 @@
|
|||
image:
|
||||
repository: ghcr.io/tommy-skaug/dispatch
|
||||
tag: v20230919
|
||||
pullPolicy: Always
|
||||
|
||||
initContainers:
|
||||
dbInit:
|
||||
image:
|
||||
repository: ghcr.io/onedr0p/postgres-init
|
||||
tag: "16"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: dispatch-secret
|
||||
|
||||
core:
|
||||
container:
|
||||
command: []
|
||||
|
||||
web:
|
||||
container:
|
||||
port: 8000
|
||||
command: ["server", "start", "dispatch.main:app", "--host=0.0.0.0"]
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
scheduler:
|
||||
command: ["scheduler", "start"]
|
||||
|
||||
configMap:
|
||||
general:
|
||||
COMPOSE_PROJECT_NAME: "dispatch"
|
||||
DATABASE_HOSTNAME: "postgres-rw.databases.svc.cluster.local"
|
||||
DATABASE_NAME: "dispatch"
|
||||
DATABASE_PORT: "5432"
|
||||
|
||||
postgres:
|
||||
secretRef:
|
||||
name: dispatch-secret
|
Loading…
Reference in a new issue