When creating a AzureFile persistent volume via a dynamic persistent volume claim the AzureFile created has no metadata

9/18/2019

I'm successfully creating persistent volumes dynamically on Azure using the kubernetes.io/azure-file provider. I can configure it to use the storage account I want and I'm generally happy except the resultant objects in Azure (as viewed through the Azure portal or using az cli) have no metadata associated with them.

I'd like to contrast this with the setup I have on AWS using the kubernetes.io/aws-ebs where the EBS volumes get tagged with tags like KubernetesCluster, Name, kubernetes.io/created-for/pv/name and kubernetes.io/created-for/pvc/name.

This info was invaluable when we lost our cluster and had to write a script to re-attach these existing volumes by creating PVs. It's also useful for a host of other reasons.

Is it possible to achieve this behaviour with the kubernetes.io/azure-file ?

-- tam203
azure
azure-aks
azure-files
kubernetes

1 Answer

9/19/2019

The only possible way to meet your requirement is the metadata of the file share. But you need to add the info you want to the metadata yourself.

Metadata for a share or file resource is stored as name-value pairs associated with the resource. Metadata names must adhere to the naming rules for C# identifiers.

enter image description here

For more details, see Metadata names.

-- Charles Xu
Source: StackOverflow