1
votes

I have three clusters in Google Kubernetes Engine, and I am trying to see Kubernetes dashboard but I get the same access-token for two different clusters.

Using kubectl config view command I get:

- name: gke_PROJECT_ZONE_A_NAME_A
  user:
    auth-provider:
      config:
        access-token: TOKEN-A

- name: gke_PROJECT_ZONE_B_NAME_B
  user:
    auth-provider:
      config:
        access-token: TOKEN-B

- name: gke_PROJECT_ZONE_C_NAME_C
  user:
    auth-provider:
      config:
        access-token: TOKEN-B

when gke_PROJECT_ZONE_B_NAME_B and gke_PROJECT_ZONE_C_NAME_C share the same access token, hence when I connect via kubectl proxy and insert the token I get the same the dashboard.

How I can refresh the access token for cluster B or C so i'll get the desired dashboard?

i've tried to use gcloud container clusters get-credentials CLUSTER-C --zone ZONE-C --project MY_PROJECT, which returns

Fetching cluster endpoint and auth data. kubeconfig entry generated for CLUSTER-C.

and afterwards I don't get any access token for CLUSTER-C

thank you

2

2 Answers

1
votes

Restarting the UI service by running kubectl proxy, entering to the UI via http://localhost:8001/ui and refreshing the page cause the access token to refresh.

0
votes

If you know your access token for CLUSTER-C, you can do this

$ kubectl config set-credentials gke_PROJECT_ZONE_C_NAME_C --token=""