From 5edd028eb2fc3da471b2b9cae74708a4e0be7e78 Mon Sep 17 00:00:00 2001 From: Martin Proffitt Date: Wed, 24 Apr 2024 08:07:56 +0200 Subject: [PATCH 1/3] Allow setting the ingress class via `spec.ingressClassName` Fixes: https://github.com/localstack/helm-charts/issues/114 The annotation `kubernetes.io/ingress.class` is deprecated and shouldn't be used for specifying the ingress class. Instead the option `ingressClassName` should be used. This introduces that as an option to values and adds additional annotation comments for enabling SSL passthrough when nginx is used as an ingress controller As a result of this change, in local testing the following side effects were observed: --- charts/localstack/templates/ingress.yaml | 4 ++++ charts/localstack/values.yaml | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/charts/localstack/templates/ingress.yaml b/charts/localstack/templates/ingress.yaml index b7cae6f..f77d9ec 100644 --- a/charts/localstack/templates/ingress.yaml +++ b/charts/localstack/templates/ingress.yaml @@ -22,6 +22,10 @@ metadata: {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: +{{- if .Values.ingress.ingressClassName }} + ingressClassName: {{ .Values.ingress.ingressClassName | quote }} +{{- end }} + {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} diff --git a/charts/localstack/values.yaml b/charts/localstack/values.yaml index cd32e99..e55963b 100644 --- a/charts/localstack/values.yaml +++ b/charts/localstack/values.yaml @@ -130,9 +130,18 @@ service: ingress: enabled: false annotations: {} - # Adjust the ingress class when not using nginx as incress controller + # Adjust the ingress class when not using nginx as ingress controller # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" + + # If you are using SSL passthrough for the certificates for nginx, uncomment the + # annotations below (note: nginx needs to be started with `--enable-ssl-passthrough` for these to work) + # nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" + # nginx.ingress.kubernetes.io/ssl-passthrough: "true" + # nginx.ingress.kubernetes.io/ssl-redirect: "true" + + # To set the ingress class via spec.ingressClassName, uncomment the line below + # ingressClassName: nginx hosts: - host: chart-example.local paths: From 7e7aeef5edcf3b6e9422ed4ec2ee6a2539d8e07a Mon Sep 17 00:00:00 2001 From: Martin Proffitt Date: Wed, 24 Apr 2024 15:54:33 +0200 Subject: [PATCH 2/3] Code cleanup - Remove comment block from values.yaml relating to deprecated settings - Remove superfluous line break --- charts/localstack/templates/ingress.yaml | 1 - charts/localstack/values.yaml | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/charts/localstack/templates/ingress.yaml b/charts/localstack/templates/ingress.yaml index f77d9ec..054f206 100644 --- a/charts/localstack/templates/ingress.yaml +++ b/charts/localstack/templates/ingress.yaml @@ -25,7 +25,6 @@ spec: {{- if .Values.ingress.ingressClassName }} ingressClassName: {{ .Values.ingress.ingressClassName | quote }} {{- end }} - {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} diff --git a/charts/localstack/values.yaml b/charts/localstack/values.yaml index e55963b..dc40531 100644 --- a/charts/localstack/values.yaml +++ b/charts/localstack/values.yaml @@ -130,16 +130,6 @@ service: ingress: enabled: false annotations: {} - # Adjust the ingress class when not using nginx as ingress controller - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - - # If you are using SSL passthrough for the certificates for nginx, uncomment the - # annotations below (note: nginx needs to be started with `--enable-ssl-passthrough` for these to work) - # nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" - # nginx.ingress.kubernetes.io/ssl-passthrough: "true" - # nginx.ingress.kubernetes.io/ssl-redirect: "true" - # To set the ingress class via spec.ingressClassName, uncomment the line below # ingressClassName: nginx hosts: From 4cddb4e63e61902c3aee1eba8a3c0a88175a9412 Mon Sep 17 00:00:00 2001 From: Martin Proffitt Date: Wed, 24 Apr 2024 16:10:58 +0200 Subject: [PATCH 3/3] Update wording on comment --- charts/localstack/values.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/localstack/values.yaml b/charts/localstack/values.yaml index dc40531..2720776 100644 --- a/charts/localstack/values.yaml +++ b/charts/localstack/values.yaml @@ -130,8 +130,9 @@ service: ingress: enabled: false annotations: {} - # To set the ingress class via spec.ingressClassName, uncomment the line below - # ingressClassName: nginx + ## @param ingress.ingressClassName Set the name of the class to use + ## + ingressClassName: "" hosts: - host: chart-example.local paths: