Clean up v1 ingress handling
This commit is contained in:
parent
296671af42
commit
8b8606d67b
6 changed files with 75 additions and 98 deletions
|
@ -1,9 +1,10 @@
|
||||||
{{- 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 }}
|
{{- $v1Ingress := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
|
||||||
|
{{- if $v1Ingress -}}
|
||||||
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,15 +33,13 @@ spec:
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: Prefix
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
number: {{ $svcPort }}
|
number: {{ $svcPort }}
|
||||||
|
pathType: Prefix
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: {{ $svcPort }}
|
servicePort: {{ $svcPort }}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.ingress.enabled -}}
|
||||||
{{- $fullName := include "funkwhale.fullname" . -}}
|
{{- $fullName := include "funkwhale.fullname" . -}}
|
||||||
---
|
{{- $v1Ingress := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
{{- if $v1Ingress -}}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
@ -34,15 +34,13 @@ spec:
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: Prefix
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
name: http
|
name: http
|
||||||
|
pathType: Prefix
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: http
|
servicePort: http
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.ingress.enabled -}}
|
||||||
{{- $fullName := include "matrix-media-repo.fullname" . -}}
|
{{- $fullName := include "matrix-media-repo.fullname" . -}}
|
||||||
{{- $svcPort := .Values.service.port -}}
|
{{- $svcPort := .Values.service.port -}}
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
{{- $v1Ingress := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
|
||||||
|
{{- if $v1Ingress -}}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
@ -33,15 +34,13 @@ spec:
|
||||||
paths:
|
paths:
|
||||||
{{- range .paths }}
|
{{- range .paths }}
|
||||||
- path: {{ . }}
|
- path: {{ . }}
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: ImplementationSpecific
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
number: {{ $svcPort }}
|
number: {{ $svcPort }}
|
||||||
|
pathType: ImplementationSpecific
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: {{ $svcPort }}
|
servicePort: {{ $svcPort }}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.ingress.enabled -}}
|
||||||
{{- $fullName := include "matrix-synapse.fullname" . -}}
|
{{- $fullName := include "matrix-synapse.fullname" . -}}
|
||||||
{{- $wkName := include "matrix-synapse.externalname" (dict "global" . "external" "wellknown-lighttpd") -}}
|
{{- $wkName := include "matrix-synapse.externalname" (dict "global" . "external" "wellknown-lighttpd") -}}
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
{{- $v1Ingress := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
|
||||||
|
{{- if $v1Ingress -}}
|
||||||
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
|
||||||
|
@ -59,30 +60,26 @@ spec:
|
||||||
{{- range $config.csPaths }}
|
{{- range $config.csPaths }}
|
||||||
{{- if $.Values.ingress.traefikPaths }}
|
{{- if $.Values.ingress.traefikPaths }}
|
||||||
- path: {{ printf "/{path:%s}" (trimPrefix "/" .) | quote }}
|
- path: {{ printf "/{path:%s}" (trimPrefix "/" .) | quote }}
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: ImplementationSpecific
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $service }}
|
name: {{ $service }}
|
||||||
port:
|
port:
|
||||||
number: 8083
|
number: 8083
|
||||||
|
pathType: ImplementationSpecific
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $service }}
|
serviceName: {{ $service }}
|
||||||
servicePort: 8083
|
servicePort: 8083
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
- path: {{ . | quote }}
|
- path: {{ . | quote }}
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: ImplementationSpecific
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $service }}
|
name: {{ $service }}
|
||||||
port:
|
port:
|
||||||
number: 8083
|
number: 8083
|
||||||
|
pathType: ImplementationSpecific
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $service }}
|
serviceName: {{ $service }}
|
||||||
servicePort: 8083
|
servicePort: 8083
|
||||||
|
@ -94,30 +91,26 @@ spec:
|
||||||
{{- range $config.paths }}
|
{{- range $config.paths }}
|
||||||
{{- if $.Values.ingress.traefikPaths }}
|
{{- if $.Values.ingress.traefikPaths }}
|
||||||
- path: {{ printf "/{path:%s}" (trimPrefix "/" .) | quote }}
|
- path: {{ printf "/{path:%s}" (trimPrefix "/" .) | quote }}
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: ImplementationSpecific
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $service }}
|
name: {{ $service }}
|
||||||
port:
|
port:
|
||||||
number: 8083
|
number: 8083
|
||||||
|
pathType: ImplementationSpecific
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $service }}
|
serviceName: {{ $service }}
|
||||||
servicePort: 8083
|
servicePort: 8083
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
- path: {{ . | quote }}
|
- path: {{ . | quote }}
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: ImplementationSpecific
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $service }}
|
name: {{ $service }}
|
||||||
port:
|
port:
|
||||||
number: 8083
|
number: 8083
|
||||||
|
pathType: ImplementationSpecific
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $service }}
|
serviceName: {{ $service }}
|
||||||
servicePort: 8083
|
servicePort: 8083
|
||||||
|
@ -141,15 +134,13 @@ spec:
|
||||||
|
|
||||||
{{- if or (has . $csHosts) (has . $s2sHosts) }}
|
{{- if or (has . $csHosts) (has . $s2sHosts) }}
|
||||||
- path: /_matrix
|
- path: /_matrix
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: Prefix
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
number: 8008
|
number: 8008
|
||||||
|
pathType: Prefix
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: 8008
|
servicePort: 8008
|
||||||
|
@ -158,15 +149,13 @@ spec:
|
||||||
|
|
||||||
{{- if and (has . $csHosts) $.Values.ingress.includeUnderscoreSynapse }}
|
{{- if and (has . $csHosts) $.Values.ingress.includeUnderscoreSynapse }}
|
||||||
- path: /_synapse
|
- path: /_synapse
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: Prefix
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
number: 8008
|
number: 8008
|
||||||
|
pathType: Prefix
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: 8008
|
servicePort: 8008
|
||||||
|
@ -176,44 +165,38 @@ spec:
|
||||||
{{- if has . $wkHosts }}
|
{{- if has . $wkHosts }}
|
||||||
{{- if $.Values.wellknown.enabled }}
|
{{- if $.Values.wellknown.enabled }}
|
||||||
- path: /.well-known/matrix/client
|
- path: /.well-known/matrix/client
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: Exact
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $wkName }}
|
name: {{ $wkName }}
|
||||||
port:
|
port:
|
||||||
number: 80
|
number: 80
|
||||||
|
pathType: Exact
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $wkName }}
|
serviceName: {{ $wkName }}
|
||||||
servicePort: 80
|
servicePort: 80
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- path: /.well-known/matrix/server
|
- path: /.well-known/matrix/server
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: Exact
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $wkName }}
|
name: {{ $wkName }}
|
||||||
port:
|
port:
|
||||||
number: 80
|
number: 80
|
||||||
|
pathType: Exact
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $wkName }}
|
serviceName: {{ $wkName }}
|
||||||
servicePort: 80
|
servicePort: 80
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
- path: /.well-known/matrix/client
|
- path: /.well-known/matrix/client
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: Exact
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{ if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
number: 8008
|
number: 8008
|
||||||
|
pathType: Exact
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: 8008
|
servicePort: 8008
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.ingress.enabled -}}
|
||||||
{{- $fullName := include "netbox.fullname" . -}}
|
{{- $fullName := include "netbox.fullname" . -}}
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
{{- $v1Ingress := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
|
||||||
|
{{- if $v1Ingress -}}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
@ -36,15 +37,13 @@ spec:
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: Prefix
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
name: http
|
name: http
|
||||||
|
pathType: Prefix
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: http
|
servicePort: http
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.ingress.enabled -}}
|
||||||
{{- $fullName := include "radosgw.fullname" . -}}
|
{{- $fullName := include "radosgw.fullname" . -}}
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
{{- $v1Ingress := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
|
||||||
|
{{- if $v1Ingress -}}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
@ -30,15 +31,13 @@ spec:
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
|
||||||
pathType: Prefix
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
{{- if $v1Ingress }}
|
||||||
service:
|
service:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
name: http
|
name: http
|
||||||
|
pathType: Prefix
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: http
|
servicePort: http
|
||||||
|
|
Loading…
Reference in a new issue