From 5e4ed30bc9ff1507da4e82fd380cb9ee8c501252 Mon Sep 17 00:00:00 2001 From: Bryton Hall Date: Wed, 8 Sep 2021 21:22:34 -0400 Subject: [PATCH] ceph: add networking.k8s.io/v1 Ingress chart compatability Kubernetes cluster versions 1.22+ must use the v1 Ingress version. Signed-off-by: Bryton Hall --- .../rook-ceph-cluster/templates/ingress.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cluster/charts/rook-ceph-cluster/templates/ingress.yaml b/cluster/charts/rook-ceph-cluster/templates/ingress.yaml index efd6dd30e..108afefe8 100644 --- a/cluster/charts/rook-ceph-cluster/templates/ingress.yaml +++ b/cluster/charts/rook-ceph-cluster/templates/ingress.yaml @@ -1,6 +1,8 @@ {{- if .Values.ingress.dashboard.host }} --- -{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }} +apiVersion: networking.k8s.io/v1 +{{ else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} apiVersion: networking.k8s.io/v1beta1 {{ else }} apiVersion: extensions/v1beta1 @@ -16,10 +18,18 @@ spec: - host: {{ .Values.ingress.dashboard.host.name }} http: paths: - - path: {{ .Values.ingress.dashboard.host.path }} + - path: {{ .Values.ingress.dashboard.host.path | default "/" }} backend: +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + service: + name: rook-ceph-mgr-dashboard + port: + name: http-dashboard + pathType: Prefix +{{- else }} serviceName: rook-ceph-mgr-dashboard servicePort: http-dashboard +{{- end }} {{- if .Values.ingress.dashboard.tls }} tls: {{- toYaml .Values.ingress.dashboard.tls | nindent 4 }} {{- end }}