1Panel-dev / webkubectl

Run kubectl command in Web Browser.
Apache License 2.0
854 stars 117 forks source link

Unable to connect to GKE Cluster #23

Closed satrox28 closed 3 years ago

satrox28 commented 3 years ago

Hi,

I am running webkubectl on my local and trying to connect my GKE cluster and getting Unauthorized, trying to authenticate for individual user account and not for serviceaccount. Do I am missing anything here?.

#gcloud config config-helper --format=json |grep id_token
#curl http://localhost:8080/api/kube-token -X POST -d '{"name":"cluster-name","apiServer":"https://1.1.1.1","token":"<REPLACED_TOKEN_WITH_ABOVE_COMMAND_VALUE>"}'

{"success":true,"token":"z99g0mpycafe2xxxxxx","message":""}

Trying to browse the below url on browser `

http://localhost:8080/terminal/?token=z99g0mpycafe2xxxxxx

`

Welcome to Web Kubectl, try kubectl --help.
> k get po
error: You must be logged in to the server (Unauthorized)
>
satrox28 commented 3 years ago

I am able to connect to the cluster using token.

#gcloud config config-helper --format=json |jq '.credential.access_token'|sed -e 's/^"//' -e 's/"$//')