csi-driver icon indicating copy to clipboard operation
csi-driver copied to clipboard

Feature: Add labels/metadata to created volumes on hetzner cloud

Open micw opened this issue 3 years ago • 15 comments

Currently, volumes are created with the pv name, so the only information about a volume is the name (pvc-{$UUID}), the size, and the creation date. To manage a larger number of volumes, it would be very good if additional labels could be added to the hcloud volume. E.g. the claim name, the namespace and annotations of the original PVC could be added as labels to the volume created in hetzner cloud.

micw avatar Sep 22 '22 10:09 micw

Additionally support for custom preset labels would be a huge helper. This could help be greater helper to identify resources in a automated environment via the hcloud cli!

captnCC avatar Oct 25 '22 08:10 captnCC

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

github-actions[bot] avatar Mar 15 '23 12:03 github-actions[bot]

Not stale!

micw avatar Mar 15 '23 12:03 micw

I am also very interested in this feature.

schmidp avatar May 13 '23 10:05 schmidp

Likewise interested. I'd like to attach the name of my kubernetes cluster to volumes to distinguish which one they belong to.

aki-ks avatar May 17 '23 12:05 aki-ks

Also interested!

kayiplar avatar Jul 30 '23 11:07 kayiplar

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

github-actions[bot] avatar Oct 28 '23 12:10 github-actions[bot]

Not stale!

micw avatar Oct 28 '23 18:10 micw

I'd love this feature, too.

jr-dimedis avatar Dec 19 '23 08:12 jr-dimedis

+1 for this feature

nicolai0 avatar Jan 13 '24 13:01 nicolai0

+1

platdesign avatar Jan 18 '24 09:01 platdesign

Some thoughts:

This is a generic csi-driver that must be compatible with other tools besides Kubernetes, accessing the Kubernetes API to get more information is out of the question.

The CreateVolume gRPC call does not include "Labels" or similar that we could directly pass through. What it makes available are map<string, string> parameters. In Kubernetes these are the options you configure in StorageClass.parameters.

Kubernetes uses a tool called external-provisioner to call CreateVolume when new PVs are created. It has a flag --extra-create-metadata, if this is active we will receive parameters for the PVC Name & Namespace and PV Name. While these are Kubernetes-specific parameters, I think we can still convert them into Volume Labels.

We could additional define a prefix like labels.csi.hetzner.cloud for parameters, such that a parameter labels.csi.hetzner.cloud/foo: bar would result in the label foo=bar on the Hetzner Cloud Volume. This could be used by any Container Orchestrator. In Kubernetes this would enable setting different labels per StorageClass, so you could for example add the name of the Cluster in there.

apricote avatar Jan 18 '24 13:01 apricote

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

github-actions[bot] avatar Apr 18 '24 12:04 github-actions[bot]

+1, we need this please.

Masegi avatar Apr 18 '24 12:04 Masegi