From 587459905d16aa58941321c100648c1a0a679ead Mon Sep 17 00:00:00 2001 From: Brad Soper Date: Thu, 15 Feb 2024 09:13:05 -0800 Subject: [PATCH] Updated all ingress templates with the if statement to check if a ingressClassName was provided --- pkg/app/controlplane/tmpl/webapp/ingress.tpl | 2 ++ pkg/app/dbs/tmpl/es/elastalert/ingress.tpl | 1 - pkg/app/dbs/tmpl/es/elastic/ingress.tpl | 2 ++ pkg/app/dbs/tmpl/es/kibana/ingress.tpl | 2 ++ pkg/app/dbs/tmpl/prom/grafana/ingress.tpl | 2 ++ pkg/app/dbs/tmpl/prom/prometheus/ingress.tpl | 2 ++ pkg/app/sso/tmpl/central/ingress.tpl | 6 ++++-- pkg/app/sso/tmpl/jwks/ingress.tpl | 6 ++++-- 8 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pkg/app/controlplane/tmpl/webapp/ingress.tpl b/pkg/app/controlplane/tmpl/webapp/ingress.tpl index 05a24015..f09d1312 100644 --- a/pkg/app/controlplane/tmpl/webapp/ingress.tpl +++ b/pkg/app/controlplane/tmpl/webapp/ingress.tpl @@ -24,7 +24,9 @@ metadata: name: {{ .Spec.ControlPlane.WebApp.SvcName }} namespace: {{ .Namespace }} spec: + {{- if ne .Spec.Networking.Ingress.IngressClassName "" }} ingressClassName: {{ .Spec.Networking.Ingress.IngressClassName }} + {{- end }} {{- if and ( isTrue .Spec.Networking.HTTPS.Enabled ) (ne .Spec.Networking.HTTPS.CertSecret "") }} tls: - hosts: diff --git a/pkg/app/dbs/tmpl/es/elastalert/ingress.tpl b/pkg/app/dbs/tmpl/es/elastalert/ingress.tpl index 67edacf2..b384d288 100644 --- a/pkg/app/dbs/tmpl/es/elastalert/ingress.tpl +++ b/pkg/app/dbs/tmpl/es/elastalert/ingress.tpl @@ -21,7 +21,6 @@ spec: {{- if ne .Spec.Networking.Ingress.IngressClassName "" }} ingressClassName: {{ .Spec.Networking.Ingress.IngressClassName }} {{- end }} - ingressClassName: {{ .Spec.Networking.Ingress.IngressClassName }} {{- if and ( isTrue .Spec.Networking.HTTPS.Enabled ) (ne .Spec.Networking.HTTPS.CertSecret "") }} tls: - hosts: diff --git a/pkg/app/dbs/tmpl/es/elastic/ingress.tpl b/pkg/app/dbs/tmpl/es/elastic/ingress.tpl index 4b19a488..52defb89 100644 --- a/pkg/app/dbs/tmpl/es/elastic/ingress.tpl +++ b/pkg/app/dbs/tmpl/es/elastic/ingress.tpl @@ -18,7 +18,9 @@ metadata: {{$k}}: "{{$v}}" {{- end }} spec: + {{- if ne .Spec.Networking.Ingress.IngressClassName "" }} ingressClassName: {{ .Spec.Networking.Ingress.IngressClassName }} + {{- end }} {{- if and ( isTrue .Spec.Networking.HTTPS.Enabled ) (ne .Spec.Networking.HTTPS.CertSecret "") }} tls: - hosts: diff --git a/pkg/app/dbs/tmpl/es/kibana/ingress.tpl b/pkg/app/dbs/tmpl/es/kibana/ingress.tpl index 7a6cd76b..34a08c91 100644 --- a/pkg/app/dbs/tmpl/es/kibana/ingress.tpl +++ b/pkg/app/dbs/tmpl/es/kibana/ingress.tpl @@ -24,7 +24,9 @@ metadata: {{$k}}: "{{$v}}" {{- end }} spec: + {{- if ne .Spec.Networking.Ingress.IngressClassName "" }} ingressClassName: {{ .Spec.Networking.Ingress.IngressClassName }} + {{- end }} {{- if and ( isTrue .Spec.Networking.HTTPS.Enabled ) (ne .Spec.Networking.HTTPS.CertSecret "") }} tls: - hosts: diff --git a/pkg/app/dbs/tmpl/prom/grafana/ingress.tpl b/pkg/app/dbs/tmpl/prom/grafana/ingress.tpl index 2ab2241d..d1faed1f 100644 --- a/pkg/app/dbs/tmpl/prom/grafana/ingress.tpl +++ b/pkg/app/dbs/tmpl/prom/grafana/ingress.tpl @@ -24,7 +24,9 @@ metadata: {{$k}}: "{{$v}}" {{- end }} spec: + {{- if ne .Spec.Networking.Ingress.IngressClassName "" }} ingressClassName: {{ .Spec.Networking.Ingress.IngressClassName }} + {{- end }} {{- if and ( isTrue .Spec.Networking.HTTPS.Enabled ) (ne .Spec.Networking.HTTPS.CertSecret "") }} tls: - hosts: diff --git a/pkg/app/dbs/tmpl/prom/prometheus/ingress.tpl b/pkg/app/dbs/tmpl/prom/prometheus/ingress.tpl index 002d385b..a384ddbd 100644 --- a/pkg/app/dbs/tmpl/prom/prometheus/ingress.tpl +++ b/pkg/app/dbs/tmpl/prom/prometheus/ingress.tpl @@ -18,7 +18,9 @@ metadata: {{$k}}: "{{$v}}" {{- end }} spec: + {{- if ne .Spec.Networking.Ingress.IngressClassName "" }} ingressClassName: {{ .Spec.Networking.Ingress.IngressClassName }} + {{- end }} {{- if and ( isTrue .Spec.Networking.HTTPS.Enabled ) (ne .Spec.Networking.HTTPS.CertSecret "") }} tls: - hosts: diff --git a/pkg/app/sso/tmpl/central/ingress.tpl b/pkg/app/sso/tmpl/central/ingress.tpl index c8c9bd2f..85bdbb79 100644 --- a/pkg/app/sso/tmpl/central/ingress.tpl +++ b/pkg/app/sso/tmpl/central/ingress.tpl @@ -18,7 +18,9 @@ metadata: name: {{.Spec.SSO.Central.SvcName}} namespace: {{.Namespace }} spec: - ingressClassName: nginx + {{- if ne .Spec.Networking.Ingress.IngressClassName "" }} + ingressClassName: {{ .Spec.Networking.Ingress.IngressClassName }} + {{- end }} {{- if and ( isTrue .Spec.Networking.HTTPS.Enabled ) (ne .Spec.Networking.HTTPS.CertSecret "") }} tls: - hosts: @@ -35,4 +37,4 @@ spec: service: name: {{.Spec.SSO.Central.SvcName}} port: - number: 8080 \ No newline at end of file + number: 8080 diff --git a/pkg/app/sso/tmpl/jwks/ingress.tpl b/pkg/app/sso/tmpl/jwks/ingress.tpl index 78dc8d34..1498d4f4 100644 --- a/pkg/app/sso/tmpl/jwks/ingress.tpl +++ b/pkg/app/sso/tmpl/jwks/ingress.tpl @@ -18,7 +18,9 @@ metadata: name: {{ .Spec.SSO.Jwks.SvcName }} namespace: {{.Namespace }} spec: - ingressClassName: nginx + {{- if ne .Spec.Networking.Ingress.IngressClassName "" }} + ingressClassName: {{ .Spec.Networking.Ingress.IngressClassName }} + {{- end }} {{- if and ( isTrue .Spec.Networking.HTTPS.Enabled ) (ne .Spec.Networking.HTTPS.CertSecret "") }} tls: - hosts: @@ -35,4 +37,4 @@ spec: service: name: "{{.Spec.SSO.Jwks.SvcName}}" port: - number: 8080 \ No newline at end of file + number: 8080