Closed bramk closed 3 weeks ago
/assign
@bramk kubernetes.io-created-for-pvc-namespace
and kubernetes.io-created-for-pvc-name
tags are for pvc, for snapshot tags, we could add the name and namespace of the source VolumeSnapshot, and source disk uri as following tags:
k8s-azure-created-by
: kubernetes-azure-dd
kubernetes.io-created-for-snapshot-namespace
: namespace
kubernetes.io-created-for-snapshot-name
: name
source_volume_id
:/subscriptions/xxx/resourceGroups/capz-kiobac/providers/Microsoft.Compute/disks/pvc-3c2dcdc0-4f41-4c06-b87e-a1642f661a6c
is that what you want?
@andyzhangx yes that would cover our current use-case as it removes the need for additional bookkeeping 👍
Is your feature request related to a problem? Please describe. When creating a VolumeSnapshot for a PVC the resulting snapshot has no tags (even though the disk does). We can add static tags through the VolumeSnapshotClass tags parameter, but this is no solution for context information like the source PVC name and namespace. Hence when the source disk is deleted is is next to impossible to determine where a snapshot came from without doing extra bookkeeping.
Describe the solution you'd like Given the fact that pvc disks are already tagged with
kubernetes.io-created-for-pvc-namespace
andkubernetes.io-created-for-pvc-name
tags it would cover our use-case if these could be propagated to the snapshot. An alternative could be to allow interpolation of values in the existing tags parameter.Describe alternatives you've considered Create a distinct VolumeSnapshotClass for every pvc name and namespace combination. Obviously this would quickly explode.
Additional context There is an open kubernetes-csi issue that talks about being able to pass resource annotation to the driver https://github.com/kubernetes-csi/external-provisioner/issues/714 The AWS EBS CSI driver has limited support for interpolation https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/docs/tagging.md