From 5136b057276142d59cdfd61df94c0f064dcf3726 Mon Sep 17 00:00:00 2001 From: Jack Jackson Date: Tue, 27 Sep 2022 11:41:17 -0700 Subject: [PATCH 1/2] Fully specify ingressClassName As per [here](https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation), the annotation-based approach of setting Ingress Class was deprecated in Kubernetes v1.18, which is presumably why there is a [check](https://github.com/grafana/oncall/blob/7deb6fb9206f7372be36c7f0c1e06880dbe83772/helm/oncall/templates/ingress-regular.yaml#L4) to only add the annotation for Kubernetes versions lower than this. However, there was no corresponding logic to add an explicit `ingressClassName` for later versions. This change adds that. --- helm/oncall/templates/ingress-regular.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helm/oncall/templates/ingress-regular.yaml b/helm/oncall/templates/ingress-regular.yaml index caa9e151..61a8401a 100644 --- a/helm/oncall/templates/ingress-regular.yaml +++ b/helm/oncall/templates/ingress-regular.yaml @@ -23,7 +23,10 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- if .Values.ingress.tls }} + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end}} + {{- if .Values.ingress.tls }} tls: {{- tpl (toYaml .Values.ingress.tls) . | nindent 4 }} {{- end }} From 96520381b1f73bdaffbeaef322d2dd45c2b521dd Mon Sep 17 00:00:00 2001 From: Jack Jackson Date: Tue, 4 Oct 2022 10:20:12 -0700 Subject: [PATCH 2/2] Update helm/oncall/templates/ingress-regular.yaml Co-authored-by: Ildar Iskhakov --- helm/oncall/templates/ingress-regular.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/oncall/templates/ingress-regular.yaml b/helm/oncall/templates/ingress-regular.yaml index 61a8401a..d29756aa 100644 --- a/helm/oncall/templates/ingress-regular.yaml +++ b/helm/oncall/templates/ingress-regular.yaml @@ -25,7 +25,7 @@ metadata: spec: {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} ingressClassName: {{ .Values.ingress.className }} - {{- end}} + {{- end }} {{- if .Values.ingress.tls }} tls: {{- tpl (toYaml .Values.ingress.tls) . | nindent 4 }}