kubernetesazure-akskubernetes-dashboard

Not able to browse Kubernetes dashboard for clusters created in Azure


Trying to access Kubernetes dashboard (Azure AKS) by using below command but getting error as attached.

az aks browse --resource-group rg-name --name aks-cluster-name --listen-port 8851

Kubernetes dashboard browing error


Solution

  • Please read AKS documentation of how to authenticate the dashboard from link. This also explains about how to enable the addon for newer version of k8s also.

    Pasting here for reference

    Use a kubeconfig

    For both Azure AD enabled and non-Azure AD enabled clusters, a kubeconfig can be passed in. Ensure access tokens are valid, if your tokens are expired you can refresh tokens via kubectl.

    1. Set the admin kubeconfig with az aks get-credentials -a --resource-group <RG_NAME> --name <CLUSTER_NAME>
    2. Select Kubeconfig and click Choose kubeconfig file to open file selector
    3. Select your kubeconfig file (defaults to $HOME/.kube/config)
    4. Click Sign In

    Use a token

    1. For non-Azure AD enabled cluster, run kubectl config view and copy the token associated with the user account of your cluster.
    2. Paste into the token option at sign in.
    3. Click Sign In

    For Azure AD enabled clusters, retrieve your AAD token with the following command. Validate you've replaced the resource group and cluster name in the command.

    kubectl config view -o jsonpath='{.users[?(@.name == "clusterUser_<RESOURCE GROUP>_<AKS_NAME>")].user.auth-provider.config.access-token}'