You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we only support retrieving the nodes' information if the k8s control plan is working correctly because we use the API server. However, it is possible to use the Azure API and avoid passing through the API server so that we can improve UX by allowing users to get such information in all the cases with kubectl-aks and they don't need to go to the portal or use az.
Here the way to do it using az, we need to find the corresponding APIs to reproduce the same programatically:
Infrastructure/Node resource group: Using the cluster name and resource group, we can retrieve the infrastructure/node resource group like this:
$ az account set --subscription <subscription-id>
$ az aks show --name <cluster-name> --resource-group <resource-name> --query nodeResourceGroup
"MC_my-rg_my-cluster_my-location"
VMSS: Using the infrastructure/node resource group name we can retrieve the VMSS:
$ az resource list --resource-group MC_my-rg_my-cluster_my-location --resource-type Microsoft.Compute/virtualMachineScaleSets --query [].name
[
"aks-agentpool-12345678-vmss"
]
VMSS Instance ID: And using the VMSS we can get the mapping between instances ID and nodes:
Currently, we only support retrieving the nodes' information if the k8s control plan is working correctly because we use the API server. However, it is possible to use the Azure API and avoid passing through the API server so that we can improve UX by allowing users to get such information in all the cases with kubectl-aks and they don't need to go to the portal or use az.
Here the way to do it using az, we need to find the corresponding APIs to reproduce the same programatically:
Infrastructure/Node resource group: Using the cluster name and resource group, we can retrieve the infrastructure/node resource group like this:
VMSS: Using the infrastructure/node resource group name we can retrieve the VMSS:
$ az resource list --resource-group MC_my-rg_my-cluster_my-location --resource-type Microsoft.Compute/virtualMachineScaleSets --query [].name [ "aks-agentpool-12345678-vmss" ]
VMSS Instance ID: And using the VMSS we can get the mapping between instances ID and nodes:
$ az vmss list-instances --resource-group MC_my-rg_my-cluster_my-location --name aks-agentpool-12345678-vmss --query "[].{VMSSInstanceID: instanceId, NodeName: osProfile.computerName}" -o table VMSSInstanceID NodeName ---------------- --------------------------------- 0 aks-agentpool-12345678-vmss000000 1 aks-agentpool-12345678-vmss000001 2 aks-agentpool-12345678-vmss000002
The text was updated successfully, but these errors were encountered: