GKE VPC Master Authorized Network

2/26/2019

I have a private GKE cluster on GCP which I access via the Google Shell via GCP (not the SDK). I can add my external shell IP the the --master-authorized-networks, but when I logout and log back in this IP address changes, so I would have to do this (and delete the old one) every time I want to make changes to my private cluster via de shell.

How can I access my private cluster via the shell without updating the external IP address in the --master-autorized-networks every time?

Any help is greatly appreciated, thanks.

-- spacewalk92
google-cloud-platform
google-cloud-shell
google-kubernetes-engine
kubernetes

1 Answer

2/27/2019

Google shell is just a VM hosted on a "temporary Server" which is running the code ( taking commands from jquery browser). After some time of being inactive the public ip assigned to that "VM" will change. That's why on the majority of the guides using the Shell the first steps are to authenticate your project.

A "Workaround" would be to create a free instance, and whitelist the IP from that Instance. or, just use the SDK.

-- Cristian Sanchez
Source: StackOverflow