K8S Lens with Google Cloud.

Art Krisada
2 min readFeb 4, 2023

--

Note on using Lens to monitor GKE.

Download Lens desktop from website and sign in/ sign up.

Next, Download and Install gcloud.

Use the install script to add gcloud CLI tools to your PATH

./google-cloud-sdk/install.sh

Login to gcloud via gloud cli.

gcloud auth login

This will popup your browser to login to your google account.

After that, you can list your project.

gcloud projects list

Then set your active project. You will need your project id.

gcloud config set project your-project-id

Then, we can get credential to connect to GKE. You need your cluster name and the zone your cluster in.

gcloud container clusters get-credentials your-cluster-name --zone=asia-southeast1-a
My cluster name is cluster-1

It will add credential in file config in .kube directory. You can check the file by command.

cat ~/.kube/config 

Then, open Lens.

Click + and navigate to ~/.kube folder then click sync.

Your cluster will appear in the list. You can double click your cluster to connect.

--

--

Art Krisada
Art Krisada

Written by Art Krisada

Never stop learning, because life never stop teaching.

Responses (1)