How to identify an aks cluster's name and resource group through metadata?
Boris Rodman
0
Reputation points
I'm trying to figure out my cluster's name using the metadata from Kubernetes api at http://169.254.169.254/metadata/instance?api-version=2021-02-01.
The returned resourceGroupName is built in the format of mc_[resource group name]_[cluster name]_[location]
, and splitting it by '_' is error-prone because both azure resource group name and cluster name can contain underscores.
I there another way of doing it?
Sign in to answer