From 772198f15d971373c507f9e467b398845494e32b Mon Sep 17 00:00:00 2001 From: Yanos Angelopoulos Date: Thu, 9 Jun 2022 13:43:20 +0300 Subject: [PATCH] Support having a single external ingress controller This change allows creating a single ingress resource using the public fqdn of the service, instead of two (cluster and namespace) that is currently the case. Every openstack-helm chart can have a network.server.ingress.use_external_ingress_controller boolean field to choose the creation of a single ingress resource (ingressName-namespace-fqdn). Signed-off-by: Yanos Angelopoulos Change-Id: I46da850fccc3fee76595a2e6c49d51197a282c3e --- helm-toolkit/Chart.yaml | 2 +- helm-toolkit/templates/manifests/_ingress.tpl | 4 +++- releasenotes/notes/helm-toolkit.yaml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/helm-toolkit/Chart.yaml b/helm-toolkit/Chart.yaml index 8821349d5..3c36b200c 100644 --- a/helm-toolkit/Chart.yaml +++ b/helm-toolkit/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Helm-Toolkit name: helm-toolkit -version: 0.2.42 +version: 0.2.43 home: https://docs.openstack.org/openstack-helm icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png sources: diff --git a/helm-toolkit/templates/manifests/_ingress.tpl b/helm-toolkit/templates/manifests/_ingress.tpl index c1693aa4e..7846895fc 100644 --- a/helm-toolkit/templates/manifests/_ingress.tpl +++ b/helm-toolkit/templates/manifests/_ingress.tpl @@ -685,7 +685,9 @@ spec: {{ $hostRules | include "helm-toolkit.manifests.ingress._host_rules" | indent 4 }} {{- end }} {{- if not ( hasSuffix ( printf ".%s.svc.%s" $envAll.Release.Namespace $envAll.Values.endpoints.cluster_domain_suffix) $hostNameFull) }} -{{- range $key2, $ingressController := tuple "namespace" "cluster" }} +{{- $ingressConf := $envAll.Values.network.server.ingress -}} +{{- $ingressClasses := ternary (tuple "namespace") (tuple "namespace" "cluster") (and (hasKey $ingressConf "use_external_ingress_controller") $ingressConf.use_external_ingress_controller) }} +{{- range $key2, $ingressController := $ingressClasses }} {{- $vHosts := list $hostNameFull }} --- apiVersion: networking.k8s.io/v1 diff --git a/releasenotes/notes/helm-toolkit.yaml b/releasenotes/notes/helm-toolkit.yaml index b19f33d58..f592c6011 100644 --- a/releasenotes/notes/helm-toolkit.yaml +++ b/releasenotes/notes/helm-toolkit.yaml @@ -49,4 +49,5 @@ helm-toolkit: - 0.2.40 Revert chart naming for subchart compatibility - 0.2.41 Database B/R - archive name parser added - 0.2.42 Database B/R - fix to make script compliant with a retention policy + - 0.2.43 Support having a single external ingress controller ...