In my cluster, I dynamically create PersistentVolume
-s provisioned by Azure File Share or Blob backend, i.e. using the Azure CSI driver and its StorageClass-es
like azurefile-csi
.
Is there any way, using labels or annotations on PersistentVolume
or PersistentVolumeClaim
objects, to tell Kubernetes to set the Azure Storage objects (File Share or Blob) with certain metadata name/value pairs?
I mean, tell Kubernetes to perform equivalent of manual command like this
az storage share metadata update --account-name a1b2c3 -n pvc-d4e5f6g7h8 --metadata CreatedBy=mloskot Customer=Demo
which sets the Azure’s object metadata like x-ms-meta-CreatedBy-mloskot
and x-ms-meta-Customer=Demo
, but I’d like to the name/value pairs to be set from the Kubernetes object’s metadata.
Then, I can query the metadata from the Azure objects, like so:
az storage share metadata show --account-name a1b2c3 -n pvc-d4e5f6g7h8
{
"CreatedBy": "mloskot",
"Customer": "Demo"
}
Is there any system of system of labels/annotations to achieve that?
Cluster information:
Kubernetes version: 1.25.5
Cloud being used: AKS