DNS & Routing for Google Compute Engine VMs from Kubernetes on Container Engine

9/8/2016

My kubernetes pods are all able to resolve hostnames and ping servers that are on the wider Internet, but they can't do either for our VMs running in the same zone & region on Google Compute Engine.

How does one tell kubernetes / docker to allow outbound traffic to the Google Compute Engine environment (our subnet is 10.240.0.0) and to resolve hostnames for that subnet using 10.240.0.1?

-- Ryan Kimber
google-compute-engine
google-kubernetes-engine
kubernetes

1 Answer

9/8/2016

Very silly mistake on my part.

Our Google Container Cluster was configured to use a custom network in the Google Developer Console, while our Google Compute Engine VMs were all configured to use the default network.

That explains that. Make sure the machines are all on the same network and then everything works as you'd hope.

-- Ryan Kimber
Source: StackOverflow