通过动态持久卷声明创建 Azure 文件持久卷时,创建的 Azure 文件没有元数据

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

我使用 kubernetes.io/azure-file 提供程序在 Azure 上成功地动态创建持久卷。我可以将其配置为使用我想要的存储帐户,我通常很高兴 除了 Azure 中的结果对象(通过 Azure 门户或使用 az cli 查看)没有关联的元数据他们。

我想将此与我在 AWS 上使用 kubernetes.io/aws-ebs 的设置进行对比,其中 EBS 卷被标记为 KubernetesClusterName、[=14] =] 和 kubernetes.io/created-for/pvc/name

当我们丢失集群并且不得不编写脚本以通过创建 PV 重新附加这些现有卷时,此信息非常宝贵。由于许多其他原因,它也很有用。

是否可以使用 kubernetes.io/azure-file 实现此行为?

唯一可能满足您要求的方法是文件共享的元数据。但是你需要自己将你想要的信息添加到元数据中。

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.

有关详细信息,请参阅 Metadata names