From 5ed8e29ca33ab0ea22189dd024f86667d759d75b Mon Sep 17 00:00:00 2001 From: Henrik Gerdes Date: Wed, 14 Aug 2024 17:12:32 +0200 Subject: [PATCH] feat: add ability to pass extra manifests to the chart (#49) Signed-off-by: Henrik Gerdes --- charts/kestra/templates/_helpers.tpl | 14 +++++++++++++- charts/kestra/templates/extra-manifests.yaml | 4 ++++ charts/kestra/values.yaml | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 charts/kestra/templates/extra-manifests.yaml diff --git a/charts/kestra/templates/_helpers.tpl b/charts/kestra/templates/_helpers.tpl index 325de79..9e5411e 100644 --- a/charts/kestra/templates/_helpers.tpl +++ b/charts/kestra/templates/_helpers.tpl @@ -270,7 +270,7 @@ spec: - name: external-secret mountPath: /app/secrets/external/ {{- end }} - + {{- if $dind }} - name: docker-dind-socket mountPath: /dind @@ -419,3 +419,15 @@ spec: {{- end -}} +{{/* +Renders a value that contains template. +Usage: +{{ include "kestra.extra-render" ( dict "value" .Values.path.to.the.Value "context" $) }} +*/}} +{{- define "kestra.extra-render" -}} + {{- if typeIs "string" .value }} + {{- tpl .value .context }} + {{- else }} + {{- tpl (.value | toYaml) .context }} + {{- end }} +{{- end -}} diff --git a/charts/kestra/templates/extra-manifests.yaml b/charts/kestra/templates/extra-manifests.yaml new file mode 100644 index 0000000..4a76929 --- /dev/null +++ b/charts/kestra/templates/extra-manifests.yaml @@ -0,0 +1,4 @@ +{{- range .Values.extraManifests }} +--- +{{ include "kestra.extra-render" (dict "value" . "context" $) }} +{{- end }} diff --git a/charts/kestra/values.yaml b/charts/kestra/values.yaml index 0208539..99be748 100644 --- a/charts/kestra/values.yaml +++ b/charts/kestra/values.yaml @@ -304,3 +304,5 @@ startupProbe: httpGetEnabled: true httpGetExtra: {} +# -- Extra Kubernetes Manifests +extraManifests: []