From 81a99c3dc6b59799215cb96ea9eec8b3f8539aaa Mon Sep 17 00:00:00 2001 From: Philipp Hossner Date: Mon, 30 Dec 2024 14:56:01 +0000 Subject: [PATCH] MAJOR: kubernetes-ingress: Make controller.config templatable --- .../ci/daemonset-customconfig-templated-values.yaml | 6 ++++++ .../ci/deployment-customconfig-templated-values.yaml | 5 +++++ kubernetes-ingress/templates/controller-configmap.yaml | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 kubernetes-ingress/ci/daemonset-customconfig-templated-values.yaml create mode 100644 kubernetes-ingress/ci/deployment-customconfig-templated-values.yaml diff --git a/kubernetes-ingress/ci/daemonset-customconfig-templated-values.yaml b/kubernetes-ingress/ci/daemonset-customconfig-templated-values.yaml new file mode 100644 index 0000000..621842a --- /dev/null +++ b/kubernetes-ingress/ci/daemonset-customconfig-templated-values.yaml @@ -0,0 +1,6 @@ +controller: + kind: DaemonSet + config: | + rate-limit: "{{ .Values.controller.configVars.rateLimit | required "controller.configVars.rateLimit is required" }}" + configVars: + rateLimit: "ON" diff --git a/kubernetes-ingress/ci/deployment-customconfig-templated-values.yaml b/kubernetes-ingress/ci/deployment-customconfig-templated-values.yaml new file mode 100644 index 0000000..e06384a --- /dev/null +++ b/kubernetes-ingress/ci/deployment-customconfig-templated-values.yaml @@ -0,0 +1,5 @@ +controller: + config: | + rate-limit: "{{ .Values.controller.configVars.rateLimit | required "controller.configVars.rateLimit is required" }}" + configVars: + rateLimit: "ON" diff --git a/kubernetes-ingress/templates/controller-configmap.yaml b/kubernetes-ingress/templates/controller-configmap.yaml index d50399b..bec7f2b 100644 --- a/kubernetes-ingress/templates/controller-configmap.yaml +++ b/kubernetes-ingress/templates/controller-configmap.yaml @@ -34,5 +34,9 @@ data: syslog-server: {{ include "kubernetes-ingress.syslogServer" . }} {{- end }} {{- if .Values.controller.config }} +{{- if eq "string" (printf "%T" .Values.controller.config) }} +{{ tpl .Values.controller.config . | indent 2 }} +{{- else }} {{ toYaml .Values.controller.config | indent 2 }} {{- end }} +{{- end }}