From 0cd419d54b66558a59072bd147a0ffca9e61622d Mon Sep 17 00:00:00 2001 From: Neville Bonavia Date: Thu, 14 Jul 2022 17:04:08 +0200 Subject: [PATCH] feat: adding ksqldb helm chart support for initcontainer, volumes and mounts --- .../cp-ksql-server/templates/deployment.yaml | 13 ++++++++++ values.yaml | 24 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/charts/cp-ksql-server/templates/deployment.yaml b/charts/cp-ksql-server/templates/deployment.yaml index b152880c..4f560b02 100644 --- a/charts/cp-ksql-server/templates/deployment.yaml +++ b/charts/cp-ksql-server/templates/deployment.yaml @@ -33,6 +33,13 @@ spec: {{- end }} {{- end }} spec: + {{- if hasKey .Values "initContainers" }} + initContainers: +{{- range $key, $value := .Values.initContainers }} + - name: {{ $key }} +{{ toYaml $value | trim | indent 8 }} +{{- end }} + {{- end }} containers: {{- if .Values.prometheus.jmx.enabled }} - name: prometheus-jmx-exporter @@ -74,6 +81,9 @@ spec: - name: ksql-queries mountPath: /etc/ksql/queries {{- end }} +{{- if hasKey .Values "extraVolumeMounts" }} +{{ toYaml .Values.extraVolumeMounts | trim | indent 10 }} +{{ end }} env: - name: KSQL_BOOTSTRAP_SERVERS value: {{ template "cp-ksql-server.kafka.bootstrapServers" . }} @@ -103,6 +113,9 @@ spec: {{ toYaml .Values.imagePullSecrets | indent 8 }} {{- end }} volumes: +{{- if hasKey .Values "extraVolumes" }} +{{ toYaml .Values.extraVolumes | trim | indent 6 }} +{{- end }} {{- if .Values.prometheus.jmx.enabled }} - name: jmx-config configMap: diff --git a/values.yaml b/values.yaml index c35748c1..9bd37ef1 100644 --- a/values.yaml +++ b/values.yaml @@ -148,6 +148,30 @@ cp-ksql-server: ksql: headless: false + ## Optionally add init containers that initialises ksqldb, like adding ksqldb-udfs in a mounted volume + # initContainers: + # init: + # image: busybox:latest + # imagePullPolicy: IfNotPresent + # command: + # - sh + # - -c + # - | + # touch /opt/ksqldb-udfs/additional-file + # volumeMounts: + # - mountPath: /opt/ksqldb-udfs + # name: extensions-volume + + ## Optionally mounts volumes to the cp-ksql-server container + # extraVolumeMounts: + # - mountPath: /opt/ksqldb-udfs + # name: extensions-volume + + ## Optionally adds additional volumes to this pod + # extraVolumes: + # - name: extensions-volume + # emptyDir: {} + ## ------------------------------------------------------ ## Control Center ## ------------------------------------------------------