From abb21a046584697e49f981fa23662f2c0852c32c Mon Sep 17 00:00:00 2001 From: Robrecht Vanhuysse Date: Fri, 27 Sep 2024 14:02:42 +0200 Subject: [PATCH 1/7] KANSUP74-12 add ingressClass config --- .../templates/ingress/alfresco-ingress.yaml | 3 +++ .../ingress/nginx-default-ingressClass.yaml | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml diff --git a/xenit-alfresco/templates/ingress/alfresco-ingress.yaml b/xenit-alfresco/templates/ingress/alfresco-ingress.yaml index 6b00afb..55830b3 100644 --- a/xenit-alfresco/templates/ingress/alfresco-ingress.yaml +++ b/xenit-alfresco/templates/ingress/alfresco-ingress.yaml @@ -9,6 +9,9 @@ metadata: {{ toYaml .Values.ingress.ingressAnnotations | nindent 4 }} {{- end }} spec: + {{- if .Values.ingress.ingressClass.enabled }} + ingressClassName: nginx-default-ingressClass + {{- end }} {{- if eq .Values.ingress.protocol "https" }} tls: - hosts: diff --git a/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml b/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml new file mode 100644 index 0000000..3e84c62 --- /dev/null +++ b/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml @@ -0,0 +1,12 @@ +{{- if .Values.ingress.ingressClass.enabled }} +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: nginx-default-ingressClass + namespace: {{ .Release.Namespace | quote }} + labels: + app.kubernetes.io/component: controller + app: nginx-default +spec: + controller: k8s.io/ingress-nginx +{{- end }} \ No newline at end of file From b97905a197cd794e67a43e95c61b55e26a6c6892 Mon Sep 17 00:00:00 2001 From: Robrecht Vanhuysse Date: Fri, 27 Sep 2024 14:13:13 +0200 Subject: [PATCH 2/7] KANSUP74-12 set default value for ingressClass.enabled to true --- xenit-alfresco/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xenit-alfresco/values.yaml b/xenit-alfresco/values.yaml index 1f1e625..8f59374 100644 --- a/xenit-alfresco/values.yaml +++ b/xenit-alfresco/values.yaml @@ -25,6 +25,8 @@ ingress: ingressAnnotations: kubernetes.io/ingress.class: "nginx" cert-manager.io/cluster-issuer: "letsencrypt-production" + ingressClass: + enabled: true defaultPath: service: nginx-default-service port: 30403 From 16aab76e97a5ae357f58c8610015f7d4264ee479 Mon Sep 17 00:00:00 2001 From: Robrecht Vanhuysse Date: Fri, 27 Sep 2024 14:54:48 +0200 Subject: [PATCH 3/7] KANSUP74-12 update ingressClassName value to conform to rfc1123 --- xenit-alfresco/templates/ingress/alfresco-ingress.yaml | 2 +- .../templates/ingress/nginx-default-ingressClass.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xenit-alfresco/templates/ingress/alfresco-ingress.yaml b/xenit-alfresco/templates/ingress/alfresco-ingress.yaml index 55830b3..31827d5 100644 --- a/xenit-alfresco/templates/ingress/alfresco-ingress.yaml +++ b/xenit-alfresco/templates/ingress/alfresco-ingress.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} spec: {{- if .Values.ingress.ingressClass.enabled }} - ingressClassName: nginx-default-ingressClass + ingressClassName: nginx-default-ingressclass {{- end }} {{- if eq .Values.ingress.protocol "https" }} tls: diff --git a/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml b/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml index 3e84c62..c8ff31f 100644 --- a/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml +++ b/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1 kind: IngressClass metadata: - name: nginx-default-ingressClass + name: nginx-default-ingressclass namespace: {{ .Release.Namespace | quote }} labels: app.kubernetes.io/component: controller From 969e86056ad534108c89b6ea9d839506317a6aaa Mon Sep 17 00:00:00 2001 From: Robrecht Vanhuysse Date: Fri, 27 Sep 2024 15:00:14 +0200 Subject: [PATCH 4/7] KANSUP74-12 update ingressClassName to match annotation value --- xenit-alfresco/templates/ingress/alfresco-ingress.yaml | 2 +- .../templates/ingress/nginx-default-ingressClass.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xenit-alfresco/templates/ingress/alfresco-ingress.yaml b/xenit-alfresco/templates/ingress/alfresco-ingress.yaml index 31827d5..f814e3e 100644 --- a/xenit-alfresco/templates/ingress/alfresco-ingress.yaml +++ b/xenit-alfresco/templates/ingress/alfresco-ingress.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} spec: {{- if .Values.ingress.ingressClass.enabled }} - ingressClassName: nginx-default-ingressclass + ingressClassName: nginx {{- end }} {{- if eq .Values.ingress.protocol "https" }} tls: diff --git a/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml b/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml index c8ff31f..5c75a0d 100644 --- a/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml +++ b/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1 kind: IngressClass metadata: - name: nginx-default-ingressclass + name: nginx namespace: {{ .Release.Namespace | quote }} labels: app.kubernetes.io/component: controller From c52aecb717e232f93ab8de3a7a21927e5f768c06 Mon Sep 17 00:00:00 2001 From: Robrecht Vanhuysse Date: Mon, 30 Sep 2024 14:47:07 +0200 Subject: [PATCH 5/7] KANSUP74-12 remove custom ingressClass definition, make ingress.ingressClassName configurable, update templating for annotation vs property --- local-values.yaml | 2 ++ .../templates/ingress/alfresco-ingress.yaml | 18 ++++++++++++++---- .../ingress/nginx-default-ingressClass.yaml | 12 ------------ xenit-alfresco/values.yaml | 3 +-- 4 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml diff --git a/local-values.yaml b/local-values.yaml index 2ca2f60..440f8ec 100644 --- a/local-values.yaml +++ b/local-values.yaml @@ -2,6 +2,8 @@ ingress: host: test protocol: http kubernetes.io/ingress.class: {} +# enabling the line below will cause the ingress.class annotation to be rendered instead of the ingressClass property +# ingressClass: null acs: resources: requests: diff --git a/xenit-alfresco/templates/ingress/alfresco-ingress.yaml b/xenit-alfresco/templates/ingress/alfresco-ingress.yaml index f814e3e..7318e07 100644 --- a/xenit-alfresco/templates/ingress/alfresco-ingress.yaml +++ b/xenit-alfresco/templates/ingress/alfresco-ingress.yaml @@ -5,12 +5,22 @@ metadata: name: alfresco-ingress namespace: {{ .Release.Namespace | quote }} annotations: - {{- if .Values.ingress.ingressAnnotations}} - {{ toYaml .Values.ingress.ingressAnnotations | nindent 4 }} + {{- if .Values.ingress.ingressAnnotations }} + {{- /* + See https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation + Remove kubernetes.io/ingress.class annotation if ingressClass is set + ingressClass can be removed from defaults by setting ingressClass: null in values override + Tied to spec.ingressClassName + */ -}} + {{- range $key, $value := .Values.ingress.ingressAnnotations }} + {{- if not ( and ($.Values.ingress.ingressClass) (eq $key "kubernetes.io/ingress.class")) }} + {{ $key }}: {{ $value }} + {{- end }} + {{- end }} {{- end }} spec: - {{- if .Values.ingress.ingressClass.enabled }} - ingressClassName: nginx + {{- if .Values.ingress.ingressClass }} + ingressClassName: {{ .Values.ingress.ingressClass }} {{- end }} {{- if eq .Values.ingress.protocol "https" }} tls: diff --git a/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml b/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml deleted file mode 100644 index 5c75a0d..0000000 --- a/xenit-alfresco/templates/ingress/nginx-default-ingressClass.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.ingress.ingressClass.enabled }} -apiVersion: networking.k8s.io/v1 -kind: IngressClass -metadata: - name: nginx - namespace: {{ .Release.Namespace | quote }} - labels: - app.kubernetes.io/component: controller - app: nginx-default -spec: - controller: k8s.io/ingress-nginx -{{- end }} \ No newline at end of file diff --git a/xenit-alfresco/values.yaml b/xenit-alfresco/values.yaml index 8f59374..23e75b9 100644 --- a/xenit-alfresco/values.yaml +++ b/xenit-alfresco/values.yaml @@ -21,12 +21,11 @@ general: selfManaged: false ingress: + ingressClass: "nginx" protocol: 'https' ingressAnnotations: kubernetes.io/ingress.class: "nginx" cert-manager.io/cluster-issuer: "letsencrypt-production" - ingressClass: - enabled: true defaultPath: service: nginx-default-service port: 30403 From 1d8720afe624d15230bf3fbc2559553b739887eb Mon Sep 17 00:00:00 2001 From: Robrecht Vanhuysse Date: Tue, 1 Oct 2024 09:47:17 +0200 Subject: [PATCH 6/7] KANSUP74-12 update changelog & readme --- CHANGELOG.md | 4 ++++ README.md | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de1749a..1676d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), chronology things are added/fixed/changed and - where possible - links to the PRs involved. ### Changes + +[v0.7.6] +* changed `alfresco-ingress` definition & default values to enable usage of `ingressClassName` property in favour of `kubernetes.io/ingress.class` annotation + [v0.7.5] * added general.hibernate to set all replicas to 0 diff --git a/README.md b/README.md index 258039b..b29e3bc 100644 --- a/README.md +++ b/README.md @@ -260,14 +260,28 @@ nginx rules to redirect the normal pages to a 503 maintenance page. * Default: None * Description: The host that points to the alfresco cluster for the syncService service +#### `ingress.ingressClass` + +* Required: false +* Default: `nginx` +* Description: Reference name for the ingressClass to be used. + Replacement for `kubernetes.io/ingress.class` annotation since it's deprecation in k8s 1.18. + Set to `null` to allow usage of `kubernetes.io/ingress.class` in the `ingress.ingressAnnotations` dict. + #### `ingress.ingressAnnotations` * Required: false * Default: ``` - kubernetes.io/ingress.class: "nginx" + kubernetes.io/ingress.class: "nginx" + cert-manager.io/cluster-issuer: "letsencrypt-production" ``` -* Description: Annotations for ingress +* Description: Annotations for ingress. +* Remarks: + * The default value of `kubernetes.io/ingress.class: "nginx"` will be filtered + out if the `ingress.ingressClass` is set (This includes the default value). + The `kubernetes.io/ingress.class` is deprecated since k8s v1.18, but some setups still rely on it. + Hence it can still be set and used if `ingress.ingressClass` is set to `null`. #### `ingress.additionalPaths` From 87d02e766dbeb59c162be36513e2a9835818eae2 Mon Sep 17 00:00:00 2001 From: RVanhuysseXenit <41945802+RVanhuysseXenit@users.noreply.github.com> Date: Wed, 2 Oct 2024 09:11:39 +0200 Subject: [PATCH 7/7] KANSUP74-12 Add brreaking change warning in changelog --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1676d21..96c5798 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,11 @@ chronology things are added/fixed/changed and - where possible - links to the PR ### Changes -[v0.7.6] -* changed `alfresco-ingress` definition & default values to enable usage of `ingressClassName` property in favour of `kubernetes.io/ingress.class` annotation +[v0.8.0] + +* **Potentially breaking change**: changed `alfresco-ingress` definition & default values to enable usage of `ingressClassName` property in favour of `kubernetes.io/ingress.class` annotation. + + **⚠️ This may particularly impact aws deployments using alb** [v0.7.5] * added general.hibernate to set all replicas to 0