Search code examples
kubernetesgoogle-kubernetes-engineamazon-vpcgoogle-vpc

GCP kubernetes service subnet cannot be access via AWS VPN


I have kubernetes instance on GCP and have network configuration like this: instance address range: 10.109.16.0/20, pods address range: 10.18.0.0/16, service address range: 10.84.16.0/20

and I have site to site vpn from AWS, I want to access service address range on kubernetes instance from AWS instance via VPN, for pods address is already connected by tested via ICMP, since the service address only open specific port I try curl specific port kubernetes service on aws instance but got timeout error

so why pod address range connected but not for service address range


Solution

  • As per GCP documentation[1],"As with any GKE cluster, Service (ClusterIP) addresses are only available from within the cluster. If you need to access a Kubernetes Service from VM instances outside of the cluster, but within the cluster's VPC network and region, create an internal TCP/UDP load balancer."

    If you are creating the service as cluster IP seems like it is not possible. Please create service type load balancer and see if everything is working as expected.

    [1]https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips#restrictions