Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access GKE kubectl proxy dashboard?

I would imagine the interface would have some button I could click to launch the kubectl proxy dashboard, but I could not find it.

I tried this command to get the token and entered it in:

gcloud container clusters get-credentials mycluster

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | awk '/^deployment-controller-token-/{print $1}') | awk '$1=="token:"{print $2}'

kubectl proxy

And it shows some things, but not others (services are missing, says it's forbidden).

How do I use kubectl proxy or show that dashboard with GKE?

like image 311
atkayla Avatar asked Jun 07 '18 18:06

atkayla


People also ask

How do I run a kubectl dashboard?

Start the kubectl proxy . To access the dashboard endpoint, open the following link with a web browser: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#!/login .

How do I access Kubernetes dashboard externally?

Open a browser and go to http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes–dashboard:/proxy/#!/login to display the Kubernetes Dashboard that was deployed when the cluster was created.

How do I open Kubernetes dashboard from terminal?

In a terminal window, enter kubectl proxy to make the Kubernetes Dashboard available. http://localhost:8001/api/v1/namespaces/kube-dashboard/services/https:kubernetes-dashboard:/proxy/#!/login.

How do I access the microk8 dashboard?

If the microk8s instance is running in a remote server, start a kubectl proxy on your local server with the admin kubernetes config. Browse to the Kubernetes dashboard here: https://127.0.0.1:10443 . On the Kubernetes Dashboard screen, select Token and enter it. Click Sign in .


1 Answers

Provided you are authenticated with gcloud auth login and the current project and k8s cluster is configured to the one you need, authenticate kubectl to the cluster (this will write ~/.kube/config):

gcloud container clusters get-credentials <cluster name> --zone <zone> --project <project>

retrieve the auth token that the kubectl itself uses to authenticate as you

gcloud config config-helper --format=json | jq -r '.credential.access_token'

run

kubectl proxy

Then open a local machine web browser on

http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy (This will only work if you checked the checkbox Deploy Dashboard in GCP console)

and use the token from the second command to log in with your Google Account's permissions.

like image 88
Alexander Avatar answered Sep 19 '22 01:09

Alexander