Skip to content
Permalink
Browse files
feat: update ingress to support apiVersion networking.k8s.io/v1 (#264)
Co-authored-by: Meelis Tamm <meelis.tamm@rangeforce.com>
  • Loading branch information
m33li5 and Meelis Tamm committed Apr 11, 2022
1 parent 6330350 commit 8baed82a9a0b5ceac4d76d1d5d27a08c75b6a854
Showing 2 changed files with 24 additions and 2 deletions.
@@ -17,7 +17,9 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "apisix-dashboard.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.Version }}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
@@ -53,9 +55,18 @@ spec:
paths:
{{- range .paths }}
- path: {{ . }}
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.Version }}
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else -}}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -17,7 +17,9 @@
{{- if (and .Values.apisix.enabled .Values.gateway.ingress.enabled) -}}
{{- $fullName := include "apisix.fullname" . -}}
{{- $svcPort := .Values.gateway.http.servicePort -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.Version }}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
@@ -49,9 +51,18 @@ spec:
paths:
{{- range .paths }}
- path: {{ . }}
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.Version }}
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}-gateway
port:
number: {{ $svcPort }}
{{- else -}}
backend:
serviceName: {{ $fullName }}-gateway
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 8baed82

Please sign in to comment.