Bump ingress api version to networking.k8s.io/v1 (#2809)
extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+ ref to: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122 Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com> Co-authored-by: David Ko <dko@suse.com>
This commit is contained in:
parent
8737c7605e
commit
47d38e621e
@ -1,5 +1,9 @@
|
||||
{{- if .Values.ingress.enabled }}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: longhorn-ingress
|
||||
@ -14,7 +18,7 @@ metadata:
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.ingressClassName }}
|
||||
{{- if and .Values.ingress.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||
ingressClassName: {{ .Values.ingress.ingressClassName }}
|
||||
{{- end }}
|
||||
rules:
|
||||
@ -22,9 +26,19 @@ spec:
|
||||
http:
|
||||
paths:
|
||||
- path: {{ default "" .Values.ingress.path }}
|
||||
{{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
|
||||
pathType: ImplementationSpecific
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: longhorn-frontend
|
||||
port:
|
||||
number: 80
|
||||
{{- else }}
|
||||
serviceName: longhorn-frontend
|
||||
servicePort: 80
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
- hosts:
|
||||
|
Loading…
Reference in New Issue
Block a user