From d28febaa61873665dfd927298e93bb88e4e8e15b Mon Sep 17 00:00:00 2001 From: Praveen M Date: Tue, 23 Jan 2024 23:07:53 +0530 Subject: [PATCH] csi: remove CSI_ENABLE_READ_AFFINITY This commit removes the `CSI_ENABLE_READ_AFFINITY` since it is no longer utilized after addition of the read affinity option per cluster via CSIDriverSpec. Signed-off-by: Praveen M --- Documentation/Helm-Charts/operator-chart.md | 2 -- PendingReleaseNotes.md | 3 ++- deploy/charts/rook-ceph/templates/configmap.yaml | 6 ------ deploy/charts/rook-ceph/values.yaml | 11 ----------- deploy/examples/operator-openshift.yaml | 10 ---------- deploy/examples/operator.yaml | 10 ---------- pkg/operator/ceph/csi/csi.go | 6 ------ pkg/operator/ceph/csi/spec.go | 2 -- pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml | 4 ---- 9 files changed, 2 insertions(+), 52 deletions(-) diff --git a/Documentation/Helm-Charts/operator-chart.md b/Documentation/Helm-Charts/operator-chart.md index c9f9439f8..dbc03ed0e 100644 --- a/Documentation/Helm-Charts/operator-chart.md +++ b/Documentation/Helm-Charts/operator-chart.md @@ -115,8 +115,6 @@ The following table lists the configurable parameters of the rook-operator chart | `csi.rbdPluginUpdateStrategy` | CSI RBD plugin daemonset update strategy, supported values are OnDelete and RollingUpdate | `RollingUpdate` | | `csi.rbdPluginUpdateStrategyMaxUnavailable` | A maxUnavailable parameter of CSI RBD plugin daemonset update strategy. | `1` | | `csi.rbdPodLabels` | Labels to add to the CSI RBD Deployments and DaemonSets Pods | `nil` | -| `csi.readAffinity.crushLocationLabels` | Define which node labels to use as CRUSH location. This should correspond to the values set in the CRUSH map. | labels listed [here](../CRDs/Cluster/ceph-cluster-crd.md#osd-topology) | -| `csi.readAffinity.enabled` | Enable read affinity for RBD volumes. Recommended to set to true if running kernel 5.8 or newer. | `false` | | `csi.registrar.image` | Kubernetes CSI registrar image | `registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.9.1` | | `csi.resizer.image` | Kubernetes CSI resizer image | `registry.k8s.io/sig-storage/csi-resizer:v1.9.2` | | `csi.serviceMonitor.enabled` | Enable ServiceMonitor for Ceph CSI drivers | `false` | diff --git a/PendingReleaseNotes.md b/PendingReleaseNotes.md index 0fa402039..609e93295 100644 --- a/PendingReleaseNotes.md +++ b/PendingReleaseNotes.md @@ -1,6 +1,7 @@ # v1.14 Pending Release Notes ## Breaking Changes - +- The removal of `CSI_ENABLE_READ_AFFINITY` option and its replacement with per-cluster +read affinity setting in cephCluster CR (CSIDriverOptions section) in [PR](https://github.com/rook/rook/pull/13665) ## Features diff --git a/deploy/charts/rook-ceph/templates/configmap.yaml b/deploy/charts/rook-ceph/templates/configmap.yaml index ee7e48142..d6af5cc79 100644 --- a/deploy/charts/rook-ceph/templates/configmap.yaml +++ b/deploy/charts/rook-ceph/templates/configmap.yaml @@ -118,12 +118,6 @@ data: CSI_TOPOLOGY_DOMAIN_LABELS: {{ .Values.csi.topology.domainLabels | join "," }} {{- end }} {{- end }} -{{- if .Values.csi.readAffinity }} - CSI_ENABLE_READ_AFFINITY: {{ .Values.csi.readAffinity.enabled | quote }} -{{- if .Values.csi.readAffinity.crushLocationLabels }} - CSI_CRUSH_LOCATION_LABELS: {{ .Values.csi.readAffinity.crushLocationLabels | join "," }} -{{- end }} -{{- end }} {{- if .Values.csi.nfs }} ROOK_CSI_ENABLE_NFS: {{ .Values.csi.nfs.enabled | quote }} {{- end }} diff --git a/deploy/charts/rook-ceph/values.yaml b/deploy/charts/rook-ceph/values.yaml index 4ca32198b..2d1e487bc 100644 --- a/deploy/charts/rook-ceph/values.yaml +++ b/deploy/charts/rook-ceph/values.yaml @@ -557,17 +557,6 @@ csi: # - topology.kubernetes.io/zone # - topology.rook.io/rack - readAffinity: - # -- Enable read affinity for RBD volumes. Recommended to - # set to true if running kernel 5.8 or newer. - # @default -- `false` - enabled: false - # -- Define which node labels to use - # as CRUSH location. This should correspond to the values set - # in the CRUSH map. - # @default -- labels listed [here](../CRDs/Cluster/ceph-cluster-crd.md#osd-topology) - crushLocationLabels: - # -- Whether to skip any attach operation altogether for CephFS PVCs. See more details # [here](https://kubernetes-csi.github.io/docs/skip-attach.html#skip-attach-with-csi-driver-object). # If cephFSAttachRequired is set to false it skips the volume attachments and makes the creation diff --git a/deploy/examples/operator-openshift.yaml b/deploy/examples/operator-openshift.yaml index 35611ed2c..37dcc65ee 100644 --- a/deploy/examples/operator-openshift.yaml +++ b/deploy/examples/operator-openshift.yaml @@ -584,16 +584,6 @@ data: # updated with node labels that define domains of interest # CSI_TOPOLOGY_DOMAIN_LABELS: "kubernetes.io/hostname,topology.kubernetes.io/zone,topology.rook.io/rack" - # Enable read affinity for RBD volumes. Recommended to - # set to true if running kernel 5.8 or newer. - CSI_ENABLE_READ_AFFINITY: "false" - # CRUSH location labels define which node labels to use - # as CRUSH location. This should correspond to the values set in - # the CRUSH map. - # Defaults to all the labels mentioned in - # https://rook.io/docs/rook/latest/CRDs/Cluster/ceph-cluster-crd/#osd-topology - # CSI_CRUSH_LOCATION_LABELS: "kubernetes.io/hostname,topology.kubernetes.io/zone,topology.rook.io/rack" - # Whether to skip any attach operation altogether for CephCSI PVCs. # See more details [here](https://kubernetes-csi.github.io/docs/skip-attach.html#skip-attach-with-csi-driver-object). # If set to false it skips the volume attachments and makes the creation of pods using the CephCSI PVC fast. diff --git a/deploy/examples/operator.yaml b/deploy/examples/operator.yaml index a41ffe5ef..169125dde 100644 --- a/deploy/examples/operator.yaml +++ b/deploy/examples/operator.yaml @@ -526,16 +526,6 @@ data: # updated with node labels that define domains of interest # CSI_TOPOLOGY_DOMAIN_LABELS: "kubernetes.io/hostname,topology.kubernetes.io/zone,topology.rook.io/rack" - # Enable read affinity for RBD volumes. Recommended to - # set to true if running kernel 5.8 or newer. - CSI_ENABLE_READ_AFFINITY: "false" - # CRUSH location labels define which node labels to use - # as CRUSH location. This should correspond to the values set in - # the CRUSH map. - # Defaults to all the labels mentioned in - # https://rook.io/docs/rook/latest/CRDs/Cluster/ceph-cluster-crd/#osd-topology - # CSI_CRUSH_LOCATION_LABELS: "kubernetes.io/hostname,topology.kubernetes.io/zone,topology.rook.io/rack" - # Whether to skip any attach operation altogether for CephCSI PVCs. # See more details [here](https://kubernetes-csi.github.io/docs/skip-attach.html#skip-attach-with-csi-driver-object). # If set to false it skips the volume attachments and makes the creation of pods using the CephCSI PVC fast. diff --git a/pkg/operator/ceph/csi/csi.go b/pkg/operator/ceph/csi/csi.go index 5415ed626..48bc7d8eb 100644 --- a/pkg/operator/ceph/csi/csi.go +++ b/pkg/operator/ceph/csi/csi.go @@ -21,7 +21,6 @@ import ( "strings" "time" - "github.com/rook/rook/pkg/operator/ceph/cluster/osd/topology" "github.com/rook/rook/pkg/operator/k8sutil" "github.com/pkg/errors" @@ -84,11 +83,6 @@ func (r *ReconcileCSI) setParams(ver *version.Info) error { return errors.Wrap(err, "failed to parse value for 'CSI_ENABLE_HOST_NETWORK'") } - if CSIParam.EnableReadAffinity, err = strconv.ParseBool(k8sutil.GetValue(r.opConfig.Parameters, "CSI_ENABLE_READ_AFFINITY", "false")); err != nil { - return errors.Wrap(err, "failed to parse value for 'CSI_ENABLE_READ_AFFINITY'") - } - CSIParam.CrushLocationLabels = k8sutil.GetValue(r.opConfig.Parameters, "CSI_CRUSH_LOCATION_LABELS", topology.GetDefaultTopologyLabels()) - // If not set or set to anything but "false", the kernel client will be enabled if strings.EqualFold(k8sutil.GetValue(r.opConfig.Parameters, "CSI_FORCE_CEPHFS_KERNEL_CLIENT", "true"), "false") { CSIParam.ForceCephFSKernelClient = "false" diff --git a/pkg/operator/ceph/csi/spec.go b/pkg/operator/ceph/csi/spec.go index f4ef79865..0adfc3a59 100644 --- a/pkg/operator/ceph/csi/spec.go +++ b/pkg/operator/ceph/csi/spec.go @@ -65,7 +65,6 @@ type Param struct { ImagePullPolicy string CSIClusterName string CSIDomainLabels string - CrushLocationLabels string GRPCTimeout time.Duration CSIEnableMetadata bool EnablePluginSelinuxHostMount bool @@ -80,7 +79,6 @@ type Param struct { EnableCSIEncryption bool EnableCSITopology bool EnableLiveness bool - EnableReadAffinity bool CephFSAttachRequired bool RBDAttachRequired bool NFSAttachRequired bool diff --git a/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml b/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml index 95153f402..960598ace 100644 --- a/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml +++ b/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml @@ -79,10 +79,6 @@ spec: {{- if .EnableCSITopology }} - "--domainlabels={{ .CSIDomainLabels }}" {{- end }} - {{- if .EnableReadAffinity }} - - "--enable-read-affinity=true" - - "--crush-location-labels={{ .CrushLocationLabels }}" - {{- end }} env: - name: POD_IP valueFrom: