outscale / osc-bsu-csi-driver

Apache License 2.0
8 stars 18 forks source link

Fix extra arg #818

Closed outscale-hmi closed 1 month ago

outscale-hmi commented 2 months ago

This PR introduces the ability to pass custom additional arguments to the sidecar containers for the provisioner, attacher, resizer, and snapshotter controllers. This change aims to enhance the flexibility and configurability of the controllers (https://github.com/outscale/osc-bsu-csi-driver/issues/809) According to this PR and to enable CrossNamespaceVolumeDataSource and this documentation. https://kubernetes-csi.github.io/docs/cross-namespace-data-sources.html We have to enable CrossNamespaceVolumeDataSource feature gates for the kube-apiserver and kube-controller-manager ( example in osc rke k8s cluster

We have to :

  1. Locate the cluster configuration file, typically named cluster.yaml.
  2. Modify the file to add the CrossNamespaceVolumeDataSource=true feature gate for both the API server and Controller Manager under the extra_args section.

services: kube-api: extra_args: feature-gates: "CrossNamespaceVolumeDataSource=true"

kube-controller: extra_args: feature-gates: "CrossNamespaceVolumeDataSource=true"

You need to apply changes to your cluster, rke up --config cluster.yaml

This will ensure that the API server and Controller Manager start with the CrossNamespaceVolumeDataSource feature gate enabled.

Next, we need to install or upgrade the OSC BSU CSI driver to ensure it is aware of the CrossNamespaceVolumeDataSource feature. Example using helm helm upgrade --install --wait --wait-for-jobs osc-bsu-csi-driver ./osc-bsu-csi-driver --namespace kube-system --set enableVolumeScheduling=true --set enableVolumeResizing=true --set enableVolumeSnapshot=true --set sidecars.provisionerImage.additionalArgs[0]=--feature-gates=CrossNamespaceVolumeDataSource=true

Now that the feature is enabled, we need to allow cross-namespace access using a ReferenceGrant. This object grants permission to access resources (like volume snapshots) in a different namespace.

outscale-hmi commented 2 months ago

@outscale-mdr I will upgrade the external snapshotter in a seperate PR