Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing volume tags through PVC annotations #700

Closed
rdpsin opened this issue Feb 1, 2022 · 2 comments
Closed

Allow passing volume tags through PVC annotations #700

rdpsin opened this issue Feb 1, 2022 · 2 comments

Comments

@rdpsin
Copy link

rdpsin commented Feb 1, 2022

There's a similar related issue here: #86

This issue proposes passing a SINGLE PVC annotation to the CSI Driver as part of CreateVolumeRequest.Parameters to allow CSI drivers to tag volumes with custom tags provided at the PVC level.

When creating a PVC, a user can specify tags to be attached to their volumes (if the driver supports it) by creating an annotation: csi/additional-volume-tags, which is a comma separated list of key-value pairs.

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvc-1
  annotations:
    csi/additional-volume-tags: "key1=value1,key2=value2"
spec:
    ...

The feature can be gated by an OPTIONAL annotation in the StorageClass, which defaults to false.

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: sc1
  annotations: 
     csi/allow-additional-volume-tags: true
spec:
     ...

Volume tags will be appended to CreateVolumeRequest.Parameters if and only if the annotation is set to true. CSI drivers are free to ignore this annotation if they don't support tagging.

I'm willing to work on a PR if the community thinks this change makes sense.

@xing-yang
Copy link
Contributor

Similar request was brought up before but didn't get accepted because it breaks PVC portability:
#425 (comment)

@xing-yang
Copy link
Contributor

cc @msau42

@rdpsin rdpsin closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants