From 45af4ef855880b8951e48245ecb336d689e70e39 Mon Sep 17 00:00:00 2001 From: Victor Getz Date: Tue, 6 Feb 2024 11:39:44 +0100 Subject: [PATCH] add ingressclassname templating --- blueprints/templates/infrastructure-charts/_helpers.tpl | 4 ++++ blueprints/templates/infrastructure-charts/ingress.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/blueprints/templates/infrastructure-charts/_helpers.tpl b/blueprints/templates/infrastructure-charts/_helpers.tpl index b8de2a8..21de3fa 100644 --- a/blueprints/templates/infrastructure-charts/_helpers.tpl +++ b/blueprints/templates/infrastructure-charts/_helpers.tpl @@ -59,4 +59,8 @@ Create the name of the service account to use {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} +{{- end }} + +{{- define "ingressClassName" -}} +{{ (.Values.ingress).className | default "traefik" }} {{- end }} \ No newline at end of file diff --git a/blueprints/templates/infrastructure-charts/ingress.yaml b/blueprints/templates/infrastructure-charts/ingress.yaml index a70f7e3..122670f 100644 --- a/blueprints/templates/infrastructure-charts/ingress.yaml +++ b/blueprints/templates/infrastructure-charts/ingress.yaml @@ -13,7 +13,7 @@ metadata: {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: - ingressClassName: {{ .className | default "traefik" }} + ingressClassName: {{ (include "ingressClassName" $) }} {{- if .defaultIngress.enabled }} {{- $certSecretName := (.defaultIngress.tls).secretName | default (printf "%s-%s" (include "myService.fullname" $) "cert")}}