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](7deb6fb920/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.
This commit is contained in:
Jack Jackson 2022-09-27 11:41:17 -07:00
parent 455321938e
commit 5136b05727

View file

@ -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 }}