Use modern ingress API correctly

This commit is contained in:
Alexander Olofsson 2021-09-03 09:47:02 +02:00
parent 8cc046b346
commit 16c2b8b648
No known key found for this signature in database
GPG key ID: D439C9470CB04C73
6 changed files with 84 additions and 0 deletions

View file

@ -33,7 +33,13 @@ spec:
paths:
- path: /
backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $fullName }}
port: {{ $svcPort }}
{{- else -}}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end -}}
{{- end }}
{{- end }}

View file

@ -35,6 +35,12 @@ spec:
paths:
- path: /
backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $fullName }}
port: http
{{- else -}}
serviceName: {{ $fullName }}
servicePort: http
{{- end -}}
{{- end }}

View file

@ -34,8 +34,14 @@ spec:
{{- range .paths }}
- path: {{ . }}
backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $fullName }}
port: {{ $svcPort }}
{{- else -}}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end -}}
{{- end }}
{{- end }}
{{- end }}

View file

@ -60,13 +60,25 @@ spec:
{{- if $.Values.ingress.traefikPaths }}
- path: {{ printf "/{path:%s}" (trimPrefix "/" .) | quote }}
backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $service }}
port: 8083
{{- else -}}
serviceName: {{ $service }}
servicePort: 8083
{{- end -}}
{{- else }}
- path: {{ . | quote }}
backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $service }}
port: 8083
{{- else -}}
serviceName: {{ $service }}
servicePort: 8083
{{- end -}}
{{- end }}
{{- end }}
{{- end }}
@ -75,13 +87,25 @@ spec:
{{- if $.Values.ingress.traefikPaths }}
- path: {{ printf "/{path:%s}" (trimPrefix "/" .) | quote }}
backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $service }}
port: 8083
{{- else -}}
serviceName: {{ $service }}
servicePort: 8083
{{- end -}}
{{- else }}
- path: {{ . | quote }}
backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $service }}
port: 8083
{{- else -}}
serviceName: {{ $service }}
servicePort: 8083
{{- end -}}
{{- end }}
{{- end }}
{{- end }}
@ -102,32 +126,62 @@ spec:
{{- if or (has . $csHosts) (has . $s2sHosts) }}
- path: /_matrix
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $fullName }}
port: 8008
{{- else -}}
serviceName: {{ $fullName }}
servicePort: 8008
{{- end -}}
{{- end }}
{{- if and (has . $csHosts) $.Values.ingress.includeUnderscoreSynapse }}
- path: /_synapse
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $fullName }}
port: 8008
{{- else -}}
serviceName: {{ $fullName }}
servicePort: 8008
{{- end -}}
{{- end }}
{{- if has . $wkHosts }}
{{- if $.Values.wellknown.enabled }}
- path: /.well-known/matrix/client
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $wkName }}
port: 80
{{- else -}}
serviceName: {{ $wkName }}
servicePort: 80
{{- end -}}
- path: /.well-known/matrix/server
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $wkName }}
port: 80
{{- else -}}
serviceName: {{ $wkName }}
servicePort: 80
{{- end -}}
{{- else }}
- path: /.well-known/matrix/client
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $fullName }}
port: 8008
{{- else -}}
serviceName: {{ $fullName }}
servicePort: 8008
{{- end -}}
{{- end }}
{{- end }}
{{- end }}

View file

@ -37,7 +37,13 @@ spec:
paths:
- path: /
backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $fullName }}
port: http
{{- else -}}
serviceName: {{ $fullName }}
servicePort: http
{{- end -}}
{{- end }}
{{- end }}

View file

@ -31,6 +31,12 @@ spec:
paths:
- path: /
backend:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
service:
name: {{ $fullName }}
port: http
{{- else -}}
serviceName: {{ $fullName }}
servicePort: http
{{- end -}}
{{- end }}