az aks get-credentials does not merge the kubeconfig when it was converted with azure kubelogin
See original GitHub issueDescribe the bug
When the kubeconfig was converted with the azure kubelogin tool by kubelogin convert-kubeconfig
, the next aks credential downloads will not be correctly merged into the kubeconfig file.
The az aks get-credentials
command will simply return (cluster name redacted)
Merged "CLUSTER_NAME" as current context in C
The kubeconfig file will not be edited by the command. I needed to manually add the new context, clusters and user to the file.
Command Name
az aks get-credentials
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
kubelogin convert-kubeconfig
az aks get-credentials --resource-group {} --name {}
Merged "CLUSTER_NAME" as current context in C
Expected Behavior
The kubernetes context will be merged into the existing kubeconfig
Environment Summary
Windows-10-10.0.19044-SP0
Python 3.10.4
Installer: MSI
azure-cli 2.37.0 *
Extensions:
managementpartner 0.1.3
Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1
Additional Context
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:7
Top Results From Across the Web
A quick look at azure/kubelogin - baeke.info
Use az aks get-credentials to obtain cluster credentials and DO NOT use –admin; this creates a kube config file on the CI/CD agent...
Read more >az aks | Microsoft Learn
Download and install kubelogin, a client-go credential (exec) plugin implementing azure authentication. az aks kanalyze. Display diagnostic results for the ...
Read more >How to deploy a Prefect 2.0 agent to an Azure Kubernetes ...
Here we are setting the output kubeconfig to an alternate location, to not merge with any existing contexts you might already have. az...
Read more >Kubelogin is not able to convert the kubeconfig to azurecli ...
Kubelogin is not able to convert the kubeconfig to azurecli format for 1.24.0 AKS cluster #3050 · az login · az aks get-credentials...
Read more >How to grant a Service Principal access to AKS API when ...
All you have to do is create a service principal with the cluster scope or ... credentials for the kubeconfig context az aks...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Import-AzAksCredential -ResourceGroupName <resource group name> -Name <AKS cluster name>
@bdschaap : what is the equivaent powershell command? I resorted to editing the current-context entry in the
.kube/config
instead of using thekubectl config set-context
command . In my situation, i am working in WSL 2 and the .kube/config lives in my Windows 10 user home.