From 2435d224fe9488367bbf44a6ccaa636b84c945b7 Mon Sep 17 00:00:00 2001 From: Ankit Date: Wed, 14 Jun 2023 09:25:29 +0530 Subject: [PATCH] changes to make ingress class name configurable --- charts/stateful/templates/ingress.yaml | 5 +++-- charts/stateful/values.yaml | 1 + charts/stateless/templates/ingress.yaml | 5 +++-- charts/stateless/values.yaml | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/charts/stateful/templates/ingress.yaml b/charts/stateful/templates/ingress.yaml index 4a1a451..b0ae75c 100644 --- a/charts/stateful/templates/ingress.yaml +++ b/charts/stateful/templates/ingress.yaml @@ -5,6 +5,7 @@ {{- $releaseNamespace := .Release.Namespace -}} {{- $env := .Values.argonaut.env -}} {{- $version := .Values.version | default .Release.Revision -}} +{{- $ingressClassName := .Values.ingressClassName -}} --- # Configure Service Ingress @@ -64,12 +65,11 @@ metadata: {{- if .external.extraAnnotations }} {{ toYaml .external.extraAnnotations | nindent 4 }} {{- end }} - kubernetes.io/ingress.class: nginx {{- if or (eq .protocol "tls-terminated") (eq .protocol "https") (eq .protocol "grpcs") }} kubernetes.io/tls-acme: "true" cert-manager.io/cluster-issuer: {{ .clusterIssuer | default "letsencrypt-prod" | quote }} {{- end }} - {{- if eq .protocol "ssl-passthrough" }} + {{- if and (eq .protocol "ssl-passthrough") (eq $ingressClassName "nginx") }} nginx.ingress.kubernetes.io/ssl-passthrough: "true" nginx.ingress.kubernetes.io/backend-protocol: "https" {{- end }} @@ -78,6 +78,7 @@ spec: {{- $servicePort := .port }} {{- $external := .external }} {{- if or (eq .protocol "http") (eq .protocol "grpc") (eq .protocol "ssl-passthrough") }} + ingressClassName: {{ $ingressClassName }} rules: {{- range $external.hosts }} - host: {{ . | quote}} diff --git a/charts/stateful/values.yaml b/charts/stateful/values.yaml index 6494791..0c26c1d 100644 --- a/charts/stateful/values.yaml +++ b/charts/stateful/values.yaml @@ -3,6 +3,7 @@ version: "v1" # appName: "nginx-demoapp" # image: "nginx" imageTag: "latest" +ingressClassName: nginx services: [] # - port: 80 # protocol: "tls-terminated" # tls-passthrough, tls-terminated, tcp, http, grpc need to be supported diff --git a/charts/stateless/templates/ingress.yaml b/charts/stateless/templates/ingress.yaml index 4a1a451..b0ae75c 100644 --- a/charts/stateless/templates/ingress.yaml +++ b/charts/stateless/templates/ingress.yaml @@ -5,6 +5,7 @@ {{- $releaseNamespace := .Release.Namespace -}} {{- $env := .Values.argonaut.env -}} {{- $version := .Values.version | default .Release.Revision -}} +{{- $ingressClassName := .Values.ingressClassName -}} --- # Configure Service Ingress @@ -64,12 +65,11 @@ metadata: {{- if .external.extraAnnotations }} {{ toYaml .external.extraAnnotations | nindent 4 }} {{- end }} - kubernetes.io/ingress.class: nginx {{- if or (eq .protocol "tls-terminated") (eq .protocol "https") (eq .protocol "grpcs") }} kubernetes.io/tls-acme: "true" cert-manager.io/cluster-issuer: {{ .clusterIssuer | default "letsencrypt-prod" | quote }} {{- end }} - {{- if eq .protocol "ssl-passthrough" }} + {{- if and (eq .protocol "ssl-passthrough") (eq $ingressClassName "nginx") }} nginx.ingress.kubernetes.io/ssl-passthrough: "true" nginx.ingress.kubernetes.io/backend-protocol: "https" {{- end }} @@ -78,6 +78,7 @@ spec: {{- $servicePort := .port }} {{- $external := .external }} {{- if or (eq .protocol "http") (eq .protocol "grpc") (eq .protocol "ssl-passthrough") }} + ingressClassName: {{ $ingressClassName }} rules: {{- range $external.hosts }} - host: {{ . | quote}} diff --git a/charts/stateless/values.yaml b/charts/stateless/values.yaml index dfcf727..86dc08f 100644 --- a/charts/stateless/values.yaml +++ b/charts/stateless/values.yaml @@ -3,6 +3,7 @@ version: "v1" # appName: "nginx-demoapp" # image: "nginx" imageTag: "latest" +ingressClassName: nginx services: [] # - port: 80 # protocol: "tls-terminated" # tls-passthrough, tls-terminated, tcp, http, grpc need to be supported