Friday, 23 September 2022

Resolve "Unable to connect to the server: getting credentials: exec: executable kubelogin not found" in AKS

az aks get-credentials  is used to get the kubeconfig updated so that we can access AKS clusters from a terminal (You need to first use az login and az account set --subscription to connect to your Azure subscription). You may encounter Unable to connect to the server: getting credentials: exec: executable kubelogin not found issue after geting credentials and when trying to execute kubectl commands such as kubectl get namespace. Let's see what we need to do to get the issue resolved.

The Issue

Unable to connect to the server: getting credentials: exec: executable kubelogin not found

It looks like you are trying to use a client-go credential plugin that is not installed.

To learn more about this feature, consult the documentation available at: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins



The Solution

Use --admin with the command, which will allow clsuter admin creds to be merged and you are good to go.

 az aks get-credentials -g yourrgname -n aksclustername --admin





No comments:

Popular Posts