element-web: Fix K8s 1.19+ ingress configuration

This commit is contained in:
Alexander Olofsson 2021-09-11 14:58:24 +02:00
parent 76d0cc3fab
commit 0478552664
No known key found for this signature in database
GPG key ID: D439C9470CB04C73

View file

@ -1,9 +1,9 @@
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- $fullName := include "element-web.fullname" . -}} {{- $fullName := include "element-web.fullname" . -}}
{{- $svcPort := .Values.service.port -}} {{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
{{- else -}} {{- else }}
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1beta1
{{- end }} {{- end }}
kind: Ingress kind: Ingress
@ -32,11 +32,11 @@ spec:
http: http:
paths: paths:
- path: / - path: /
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} {{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: Prefix pathType: Prefix
{{- end }} {{- end }}
backend: backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} {{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service: service:
name: {{ $fullName }} name: {{ $fullName }}
port: port: