question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az aks get-credentials does not merge the kubeconfig when it was converted with azure kubelogin

See original GitHub issue

Describe 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:open
  • Created a year ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

1reaction
bdschaapcommented, Sep 29, 2022

Import-AzAksCredential -ResourceGroupName <resource group name> -Name <AKS cluster name>

1reaction
ynuxcommented, Sep 29, 2022

@bdschaap : what is the equivaent powershell command? I resorted to editing the current-context entry in the .kube/config instead of using the kubectl config set-context command . In my situation, i am working in WSL 2 and the .kube/config lives in my Windows 10 user home.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found