Closed kayrus closed 1 week ago
I reviewed the https://github.com/awslabs/volume-modifier-for-k8s sidecar code, and it seems there's no straightforward way to intercept the CreateVolume
request without resorting to workarounds like mutexKV[volID]
. When PVC annotations feature is enabled, the CreateVolume
request must wait for the corresponding ModifyVolumeProperties
request to be processed, which introduces complexity.
An alternative approach would be to embed a Kubernetes client inside the CSI controller and fetch annotations during the CreateVolume
request.
Ideally, leveraging VolumeAttributesClass
parameters would be a cleaner solution. However, due to affinity constraints (like the volume ID list), this parameter would likely be unique per PVC rather than a shared VolumeAttributesClass
.
Is this a BUG REPORT or FEATURE REQUEST?:
/kind feature
What happened:
The Manila API allows to specify a share group in which the new share should be created. Along with this it supports affinity/anti-affinity scheduler hints.
What you expected to happen:
The share group ID can be specified in manila storage class:
The scheduler hints for a particular share can be specified in a PVC annotation like it's donw in AWS EBS CSI driver:
The proposed annotation keys are:
manila.csi.openstack.org/affinity: %shareID1%,%shareID2%
manila.csi.openstack.org/anti-affinity: %shareID3%,%shareID4%
manila.csi.openstack.org/group-id: %groupID%
- will override the SC group IDThe PVC with the annotations below:
and storage class:
will produce an API call below:
Accessing PVC annotations can be supported with a side-car modifier, see https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/1600 for example.
How to reproduce it:
n/a
Anything else we need to know?:
Upstream gophercloud feature request for the scheduler hints: https://github.com/gophercloud/gophercloud/issues/3204
Additionally we can implement the VolumeAttributesClass support.
VolumeAttributesClass
parameters will overrideStorageClass
parameters, and PVC annotations will overrideVolumeAttributesClass
parameters. For thevolumeAttributesClassName
support manila CSI must have a k8s client configured. However this can be an extra task. See https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/1941 for reference. This approach won't require a side-car container to fetch PVC annotations.Environment: