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

Support specifying volume tags via PVC labels or annotations #1876

Open
tsjnsn opened this issue Dec 19, 2023 · 6 comments
Open

Support specifying volume tags via PVC labels or annotations #1876

tsjnsn opened this issue Dec 19, 2023 · 6 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@tsjnsn
Copy link

tsjnsn commented Dec 19, 2023

Is your feature request related to a problem?/Why is this needed
Applying unique sets of tags based on application requirements currently requires creating a storageclass specific to the application and set of tags. This makes it difficult to maintain tags when there is a lot of variety in keys and values

/feature

Describe the solution you'd like in detail
Ideally, you could specify list of tags in the PVC, that way the storage class can remain application-agnostic. One of the following options should work -

  • controller can inspect a pre-defined annotation or label on the PVC to determine which AWS tags should be applied to the volume
  • the existing templating for StorageClasses can be extended to expose PVC labels/annotations so any custom tags in the PVC can be referenced there

Describe alternatives you've considered

Additional context

@TomBillietKlarrio
Copy link

also: it would allow tags to be changed. Since you can't update storageclasses (they're immutable)

@michealliang123
Copy link

If we can use PVC lable against sc in dynamic provisioning,This is great for maintaining your own tags independently between each project!

@torredil
Copy link
Member

Hi all, thanks for the feature request - we've made a note of this and will evaluate it in the near future.

One key consideration is that there is currently a limitation in Kubernetes where CSI drivers do not have the ability to retrieve tags applied to a PVC from the CreateVolume request passed in by the external provisioner.

We will provide more updates as we make progress on the evaluation and any plans to support this, thanks!

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 24, 2024
@ishaankalra
Copy link

@torredil Till then, cant we have the labels/annotation part at least, considering it cannot be changed once created?

@nickvanw
Copy link

If it's useful, we (PlanetScale) worked around this limitation by deploying https://github.com/mtougeron/k8s-pvc-tagger which supports AWS and GCP

@ConnorJC3
Copy link
Contributor

Hi all, after some discussion, we don't currently plan to support this in the driver itself.

The Kubernetes community intentionally does not supply annotations/labels to CSI drivers: kubernetes-csi/external-provisioner#86. Because of this, the only solution would involve a work-around that directly bypasses this design and introduces race condition and correctness concerns.

We do support dynamic tag values based on the PVC name and namespace, and the PV name: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/docs/tagging.md#storageclass-tagging. We have seen these features utilized in usecases such as cost tagging and tagging volumes for DLM policies.

We are working on the ability to modify the tags of existing volumes using Kubernetes's VolumeAttributesClass feature. We expect to release this capability sometime in the next few EBS CSI releases. (Note, however, that because VACs are an alpha feature they are not yet supported by EKS. We are engaging with the upstream community to push VAC to beta/GA in future Kubernetes releases.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

8 participants