|
2 | 2 | {{- $fullName := include "mastodon.fullname" . -}}
|
3 | 3 | {{- $webPort := .Values.mastodon.web.port -}}
|
4 | 4 | {{- $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 -}} |
6 | 8 | apiVersion: networking.k8s.io/v1beta1
|
7 | 9 | {{- else -}}
|
8 | 10 | apiVersion: extensions/v1beta1
|
@@ -35,12 +37,32 @@ spec:
|
35 | 37 | {{- range .paths }}
|
36 | 38 | - path: {{ .path }}
|
37 | 39 | 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 }} |
38 | 46 | serviceName: {{ $fullName }}-web
|
39 | 47 | 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 }} |
40 | 52 | - path: {{ .path }}api/v1/streaming
|
41 | 53 | 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 }} |
42 | 60 | serviceName: {{ $fullName }}-streaming
|
43 | 61 | 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 }} |
44 | 66 | {{- end }}
|
45 | 67 | {{- end }}
|
46 | 68 | {{- end }}
|
0 commit comments