From 18040ae61839a44e2f131d7915564b9073581d6f Mon Sep 17 00:00:00 2001 From: Julien Francoz Date: Sun, 4 Feb 2024 19:16:15 +0000 Subject: [PATCH] use tpl in backendService Allow to specify backendService via the tpl function, when used as an HELM dependency --- chart/templates/deployment.yaml | 2 +- chart/templates/statefulset.yaml | 2 +- chart/values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 6eebd47..8518cce 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -78,7 +78,7 @@ spec: {{- else }} - -backend-watch=false {{- end }} - - -backend-service={{ .Values.cache.backendService }} + - -backend-service={{ tpl .Values.cache.backendService . }} - -backend-namespace={{ .Values.cache.backendServiceNamespace | default "$(NAMESPACE)" }} - -varnish-secret-file=/etc/varnish/k8s-secret/secret - -varnish-vcl-template=/etc/varnish/tmpl/default.vcl.tmpl diff --git a/chart/templates/statefulset.yaml b/chart/templates/statefulset.yaml index a851ff5..d62c5f7 100644 --- a/chart/templates/statefulset.yaml +++ b/chart/templates/statefulset.yaml @@ -72,7 +72,7 @@ spec: - -backend-watch=false {{- end }} - -backend-namespace={{ .Values.cache.backendServiceNamespace | default "$(NAMESPACE)" }} - - -backend-service={{ .Values.cache.backendService }} + - -backend-service={{ tpl .Values.cache.backendService . }} - -varnish-secret-file=/etc/varnish/k8s-secret/secret - -varnish-vcl-template=/etc/varnish/tmpl/default.vcl.tmpl - -varnish-storage={{ .Values.cache.varnishStorage }},{{ .Values.cache.storageSize }} diff --git a/chart/values.yaml b/chart/values.yaml index 7f3feaf..095f56b 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -26,7 +26,7 @@ configmap: cache: # name of frontend service # frontendService: kube-httpcache-headless - # name of backend service + # name of backend service (this value is evaluated as a template) backendService: backend-service # name of backend service namespace # backendServiceNamespace: backend-service-namespace