Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] Support importing configuration regardless the status of the k8s control plan #37

Closed
blanquicet opened this issue May 26, 2023 · 0 comments · Fixed by #39
Closed
Assignees
Labels
config Command config
Milestone

Comments

@blanquicet
Copy link
Member

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:

$ 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 
@blanquicet blanquicet added this to the v0.3.0 milestone May 26, 2023
@blanquicet blanquicet added the config Command config label May 26, 2023
@mqasimsarfraz mqasimsarfraz self-assigned this Jun 29, 2023
@blanquicet blanquicet modified the milestones: v0.3.0, v0.2.2 Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Command config
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants