ceph / ceph-csi-operator

Kubernetes operator for managing the CephCSI plugins
Apache License 2.0
16 stars 18 forks source link

Read affinity args are not added to (CephFS/RBD) NodePlugin #158

Open iPraveenParihar opened 1 month ago

iPraveenParihar commented 1 month ago

Describe the bug

I see a way to enable read affinity and pass crush location labels in CephConnection CR which I did

$ k get cephconnections.csi.ceph.io ceph-cluster -ojsonpath='{.spec}' | jq
{
  "monitors": [
    "10.98.80.66:6789"
  ],
  "readAffinity": {
    "crushLocationLabels": [
      "kubernetes.io/hostname",
      "topology.kubernetes.io/region",
      "topology.kubernetes.io/zone",
      "topology.rook.io/chassis",
      "topology.rook.io/rack",
      "topology.rook.io/row",
      "topology.rook.io/pdu",
      "topology.rook.io/pod",
      "topology.rook.io/room",
      "topology.rook.io/datacenter"
    ]
  }
}

But still the read affinity args not added to (cephfs/rbd) nodeplugin. Looks like, we missed adding those? https://github.com/ceph/ceph-csi-operator/blob/02aac5ea4caf06ce683c28f124956914486c81be/internal/controller/driver_controller.go#L996-L1042

ceph-csi reference - https://github.com/ceph/ceph-csi/blob/8ddb615df28f5b9dabfb92fad12565206813a04c/deploy/rbd/kubernetes/csi-rbdplugin.yaml#L50-L57

Madhu-1 commented 1 month ago

Yes it looks like, please feel free to assign it if you are planning to work on it.

iPraveenParihar commented 1 month ago

Thought about it 🤔, I checked the ceph-csi implementation of readAffinity and the nodePlugin arg --crush-location-labels (--enable-read-affinity=true, defaults false) are consider only when the readAffinity: true and crushLocationLabels is empty in ceph-csi-config ConfigMap.

initially, the readAffinity was provided from nodeplugin args but later we moved it to ceph-csi-config CM. But nodeplugin args stayed for backward compatibility. I think in operator it actually doesn't require to add the readAffinity args in nodeplugin. Users moving to operator deployment should take care of setting readAffinity as required.

@Madhu-1, do you have different thoughts on this?

Madhu-1 commented 1 month ago

Thought about it 🤔, I checked the ceph-csi implementation of readAffinity and the nodePlugin arg --crush-location-labels (--enable-read-affinity=true, defaults false) are consider only when the readAffinity: true and crushLocationLabels is empty in ceph-csi-config ConfigMap.

initially, the readAffinity was provided from nodeplugin args but later we moved it to ceph-csi-config CM. But nodeplugin args stayed for backward compatibility. I think in operator it actually doesn't require to add the readAffinity args in nodeplugin. Users moving to operator deployment should take care of setting readAffinity as required.

@Madhu-1, do you have different thoughts on this?

Now i remember that was the reason we considered not to add it to the NodePlugin but rather kept it at configmap, if the feature is not working as expected we can add it to the Cli argument, please test out the functionality and see if its working as expected or not.