az aks get-credentials throws KeyError: 'clusters'
See original GitHub issueThis is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az aks get-credentials
Errors:
'clusters'
Traceback (most recent call last):
python3.8/site-packages/knack/cli.py, ln 215, in invoke
cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 654, in execute
raise ex
cli/core/commands/__init__.py, ln 718, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 711, in _run_job
six.reraise(*sys.exc_info())
lib/python3.8/site-packages/six.py, ln 703, in reraise
raise value
...
cli/command_modules/acs/custom.py, ln 3204, in _print_or_merge_credentials
merge_kubernetes_configurations(path, temp_path, overwrite_existing, context_name)
cli/command_modules/acs/custom.py, ln 1184, in merge_kubernetes_configurations
_handle_merge(existing, addition, 'clusters', replace)
cli/command_modules/acs/custom.py, ln 1120, in _handle_merge
if existing[key] is None:
KeyError: 'clusters'
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here…
az aks get-credentials --resource-group {} --name {}
Expected Behavior
Environment Summary
macOS-10.15.5-x86_64-i386-64bit
Python 3.8.3
Installer: HOMEBREW
azure-cli 2.7.0
Additional Context
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Azure Kubernetes Error when running "az aks get- ...
When you use the command az aks get-credentials without parameter --admin , it means the CLI command uses the default value: Cluster user....
Read more >Reset the credentials for a cluster - Azure Kubernetes Service
To update the credentials for the existing service principal, get the service principal ID of your cluster using the az aks show command....
Read more >kubectl apply release task cannot pull from Azure Container ...
(create a Service Principal for pulling an image, then using the ID and password). Again, this worked locally to update the cluster, but...
Read more >How To login to azure kubernetes cluster
Run az aks get-credentials to download credentials for the cluster into .kube/config. Run kubectl commands. The first command may trigger ...
Read more >Azure AKS Cluster Access with Multiple Clusters
Understand how to access multiple Azure Kubernetes AKS Clusters using kubectl. ... Configure AKSDEMO3 & 4 Cluster Access for kubectl az aks get-credentials...
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
I’m having this issue too:
I believe that this is a bug in the CLI, located here
We assume that the existing config has all of the keys (
clusters
,contexts
, etc). Clearly though, it’s possible that this isn’t the case.Other tooling (for example
kind
), handles this just fine - here’s my config after runningkind create cluster
And then again after
kind delete cluster
I believe the fix is pretty simple… I’ve sent a PR: #14914
Hi, we’re sending this friendly reminder because we haven’t heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don’t hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!