I'm trying to log into a kubernetes dashboard with a token given to me by my organization, but the token does not work.

Duane Wolford 26 Reputation points

So as stated, I can't get in to the dashboard. The first option is a token, the second option to get in is with a kubeconfig file. I want to use a token, but the one given to me doesn't work

Here are the commands I ran, which they said should work to get me in, but no matter what, the token they gave me is not working.

az aks get-credentials --resource-group rg-aks-nonprod-eastus-001 --name aks-nonprod-eastus-001 --admin -a

az account show (I verified that it is the correct Azure account)

kubectl port-forward -n kube-system service/kubernetes-dashboard 8080:443

Those above statements get me to the dashboard locally on 443, no problem. And the Azure configuration is verified, and I've already logged into azure using the CLI

C:\kubectl>kubectl config view
apiVersion: v1

  • cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://aks-nonprod-eastus-001-dns-a7d8ab13.hcp.eastus.azmk8s.io:443
    name: aks-nonprod-eastus-001
  • context:
    cluster: aks-nonprod-eastus-001
    user: clusterAdmin_rg-aks-nonprod-eastus-001_aks-nonprod-eastus-001
    name: aks-nonprod-eastus-001-admin
    current-context: aks-nonprod-eastus-001-admin
    kind: Config
    preferences: {}
  • name: clusterAdmin_rg-aks-nonprod-eastus-001_aks-nonprod-eastus-001
    client-certificate-data: REDACTED
    client-key-data: REDACTED
    token: REDACTED

Can someone help me with this? I need to get either the token I was given working (I think everybody is using the same one) or get a new one. I'd prefer to use the one I was given.



Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,789 questions
0 comments No comments
{count} votes

Accepted answer
  1. Winston 2,761 Reputation points

    Hi @Duane Wolford ,

    Using powershell on your local system you can do:

    Store the credentials in kube config

    az aks get-credentials --resource-group rg-aks-nonprod-eastus-001 --name aks-nonprod-eastus-001 --admin -a

    Rip credential secret token from kube config

    kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | sls admin-user | ForEach-Object { $_ -Split '\s+' } | Select -First 1)

    Start local proxy

    kubectl proxy

    Open web browser to proxy url


    Paste in the cred secret token you dumped earlier from kube config


    If this helps you solve your problem please mark this answer as accepted to help others with similar questions

    0 comments No comments

0 additional answers

Sort by: Most helpful