csi-driver
csi-driver copied to clipboard
Feature: Add labels/metadata to created volumes on hetzner cloud
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.
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!
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.
Not stale!
I am also very interested in this feature.
Likewise interested. I'd like to attach the name of my kubernetes cluster to volumes to distinguish which one they belong to.
Also interested!
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.
Not stale!
I'd love this feature, too.
+1 for this feature
+1
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.
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.
+1, we need this please.