From e01292c4a5f472c081b61e3d0d45e9c77319c8ae Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 14 Jan 2021 07:08:50 +0100 Subject: [PATCH] k8s: bump Ingress apiVersion to v1 if capability exist (k8s 1.19+) --- jupyterhub/templates/ingress.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/jupyterhub/templates/ingress.yaml b/jupyterhub/templates/ingress.yaml index 313b0ba87a..62dc941f72 100644 --- a/jupyterhub/templates/ingress.yaml +++ b/jupyterhub/templates/ingress.yaml @@ -1,8 +1,8 @@ {{- if .Values.ingress.enabled -}} -{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} -apiVersion: networking.k8s.io/v1beta1 +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} +apiVersion: networking.k8s.io/v1 {{- else }} -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 {{- end }} kind: Ingress metadata: @@ -22,9 +22,18 @@ spec: http: paths: - path: {{ $.Values.hub.baseUrl }}{{ $.Values.ingress.pathSuffix }} + {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + pathType: Prefix + backend: + service: + name: proxy-public + port: + name: http + {{- else }} backend: serviceName: proxy-public servicePort: 80 + {{- end }} {{- end }} {{- if .Values.ingress.tls }} tls: