Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.

Commit 5533fa2

Browse files
authored
Add support >= 1.22 (mastodon#17490)
1 parent 3aebe71 commit 5533fa2

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

chart/templates/ingress.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
{{- $fullName := include "mastodon.fullname" . -}}
33
{{- $webPort := .Values.mastodon.web.port -}}
44
{{- $streamingPort := .Values.mastodon.streaming.port -}}
5-
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
5+
{{- if or (.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") (not (.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress")) }}
6+
apiVersion: networking.k8s.io/v1
7+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
68
apiVersion: networking.k8s.io/v1beta1
79
{{- else -}}
810
apiVersion: extensions/v1beta1
@@ -35,12 +37,32 @@ spec:
3537
{{- range .paths }}
3638
- path: {{ .path }}
3739
backend:
40+
{{- if or ($.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") (not ($.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress")) }}
41+
service:
42+
name: {{ $fullName }}-web
43+
port:
44+
number: {{ $webPort }}
45+
{{- else }}
3846
serviceName: {{ $fullName }}-web
3947
servicePort: {{ $webPort }}
48+
{{- end }}
49+
{{- if or ($.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") (not ($.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress")) }}
50+
pathType: ImplementationSpecific
51+
{{- end }}
4052
- path: {{ .path }}api/v1/streaming
4153
backend:
54+
{{- if or ($.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") (not ($.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress")) }}
55+
service:
56+
name: {{ $fullName }}-streaming
57+
port:
58+
number: {{ $streamingPort }}
59+
{{- else }}
4260
serviceName: {{ $fullName }}-streaming
4361
servicePort: {{ $streamingPort }}
62+
{{- end }}
63+
{{- if or ($.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") (not ($.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress")) }}
64+
pathType: ImplementationSpecific
65+
{{- end }}
4466
{{- end }}
4567
{{- end }}
4668
{{- end }}

0 commit comments

Comments
 (0)