From e23aa3c7cc34e26de70fae16712ee799a42d7a4b Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Mon, 7 Apr 2025 16:04:22 -0600 Subject: [PATCH] helm: remove obsolete check for network v1 api The networking.k8s.io/v1beta1 has been obsolete since K8s 1.22, long out of the supported versions, so we can remove those legacy checks and require the v1 networking api. Signed-off-by: Travis Nielsen (cherry picked from commit c40477ccc24f9660966b7dd8fa6e08b138447beb) --- .../charts/rook-ceph-cluster/templates/_helpers.tpl | 11 ----------- .../templates/cephobjectstore-ingress.yaml | 7 +------ .../charts/rook-ceph-cluster/templates/ingress.yaml | 11 +---------- 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/deploy/charts/rook-ceph-cluster/templates/_helpers.tpl b/deploy/charts/rook-ceph-cluster/templates/_helpers.tpl index dbb065ffa..6f0a0f9a2 100644 --- a/deploy/charts/rook-ceph-cluster/templates/_helpers.tpl +++ b/deploy/charts/rook-ceph-cluster/templates/_helpers.tpl @@ -11,14 +11,3 @@ Return the target Kubernetes version. {{- define "capabilities.kubeVersion" -}} {{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}} {{- end }} - -{{/* -Return the appropriate apiVersion for ingress. -*/}} -{{- define "capabilities.ingress.apiVersion" -}} -{{- if semverCompare "<1.19-0" (include "capabilities.kubeVersion" .) -}} -{{- print "networking.k8s.io/v1beta1" -}} -{{- else -}} -{{- print "networking.k8s.io/v1" -}} -{{- end }} -{{- end }} diff --git a/deploy/charts/rook-ceph-cluster/templates/cephobjectstore-ingress.yaml b/deploy/charts/rook-ceph-cluster/templates/cephobjectstore-ingress.yaml index bb0934124..c86ed9ba3 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephobjectstore-ingress.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephobjectstore-ingress.yaml @@ -1,7 +1,7 @@ {{- range .Values.cephObjectStores }} {{- if dig "ingress" "enabled" false . }} --- -apiVersion: {{ include "capabilities.ingress.apiVersion" $ }} +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ .name }} @@ -16,16 +16,11 @@ spec: paths: - path: {{ .ingress.host.path | default "/" }} backend: -{{- if (eq "networking.k8s.io/v1" (include "capabilities.ingress.apiVersion" $)) }} service: name: rook-ceph-rgw-{{ .name }} port: number: {{ .spec.gateway.securePort | default .spec.gateway.port }} pathType: {{ .ingress.host.pathType | default "Prefix" }} -{{- else }} - serviceName: rook-ceph-rgw-{{ .name }} - servicePort: {{ .spec.gateway.securePort | default .spec.gateway.port }} -{{- end }} {{- with .ingress.ingressClassName }} ingressClassName: {{ . }} {{- end }} diff --git a/deploy/charts/rook-ceph-cluster/templates/ingress.yaml b/deploy/charts/rook-ceph-cluster/templates/ingress.yaml index f915575f4..ecfb7c470 100644 --- a/deploy/charts/rook-ceph-cluster/templates/ingress.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/ingress.yaml @@ -1,6 +1,6 @@ {{- if .Values.ingress.dashboard.host }} --- -apiVersion: {{ include "capabilities.ingress.apiVersion" . }} +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ template "clusterName" . }}-dashboard @@ -15,7 +15,6 @@ spec: paths: - path: {{ .Values.ingress.dashboard.host.path | default "/" }} backend: -{{- if (eq "networking.k8s.io/v1" (include "capabilities.ingress.apiVersion" .)) }} service: name: rook-ceph-mgr-dashboard port: @@ -25,14 +24,6 @@ spec: name: http-dashboard {{- end }} pathType: {{ .Values.ingress.dashboard.host.pathType | default "Prefix" }} -{{- else }} - serviceName: rook-ceph-mgr-dashboard - {{- if .Values.cephClusterSpec.dashboard.ssl }} - servicePort: https-dashboard - {{- else }} - servicePort: http-dashboard - {{- end }} -{{- end }} {{- if .Values.ingress.dashboard.ingressClassName }} ingressClassName: {{ .Values.ingress.dashboard.ingressClassName }} {{- end }}