Azure AKS Dynamic Disk - Give Name to Azure Resource

259 Views Asked by At

REF: https://learn.microsoft.com/en-us/azure/aks/azure-disks-dynamic-pv

Hello All,

When we create a Disk Dynamically in AKS, we get to see disk in Azure portal (under Disks) with name kubernetes-dynamic-pvc-XXXXX.... Can give a custom name like (Mongo-Disk or ELK-Disk).?

Thanks in advance.

2

There are 2 best solutions below

0
On

Unfortunately, there isn't any way to set the Disk Image Name from the StorageClass when using Dynamic PVC.

If you absolutely need to have a Disk with a precise name, I would recommend to use a static Disk Image : https://learn.microsoft.com/en-us/azure/aks/azure-disk-volume

This way, you will be able to create your disk in advance and give it the name that you are interested in.

0
On

I noticed that AKS automatically adds descriptive tags to the Azure Disks it provisions dynamically:

  1. kubernetes.io-created-for-pvc-namespace
  2. kubernetes.io-created-for-pvc-name

The tags include the K8s namespace and the name of the corresponding Persistent Volume Claim.