How to let GKE pods connect to local device

116 Views Asked by At

I am new to K8s and GKE. I have a VPC subnet 10.3.0.0/16, and I have VPN tunnel connect to local gateway, so if I create a Compute Engine on this VPC subnet, I can successfully ping to a local IP like 192.168.15.230. But when I create a GKE cluster on this VPC subnet, I found that pods on GKE cluster hosted on another IPv4 address range 10.65.0.0/17. If I want to let Pod connect to local IP 192.168.15.230, what should I do?

What I have tried:

  • When I was creating a GKE cluster on VPC subnet 10.3.0.0/16, I found that setting Cluster default pod address range on 10.3.0.0/16 is not allowed. What should I do to set it to be on VPC subnet 10.3.0.0/16? Or is this concept correct?
  • I tried create a Compute Engine instance on VPC subnet 10.3.0.0/16 and start a docker container in it. Then I go a 172.18.. IP and I can connect to local IP 192.168.15.230 in this container. But why can't I connect to local IP in a GKE pod?
0

There are 0 best solutions below