Mounting Google Cloud network locally

12/5/2018

We have a Google Cloud project with several VM instances and also Kubernetes cluster.

I am able to easily access Kubernetes services with kubefwd and I can ping them and also curl them. The problem is that kubefwd works only for Kubernetes, but not for other VM instances.

Is there a way to mount the network locally, so I could ping and curl any instance without it having public IP and with DNS the same as inside the cluster?

-- Vojtěch
gcloud
kubernetes
networking

1 Answer

12/19/2018

I would highly recommend rolling a vpn server like openvpn. You can also run this inside of the Kubernetes Cluster.

I have a make install ready repo for ya to check out at https://github.com/mateothegreat/k8-byexamples-openvpn.

Basically openvpn is running inside of a container (inside of a pod) and you can set the routes that you want the client(s) to be able to see.

I would not rely on kubefwd as it isn't production grade and will give you issues with persistent connections.

Hope this help ya out.. if you still have questions/concerns please reach out.

-- yomateo
Source: StackOverflow