Connect From GKE Kubernetes Pod To GCE VM Instance

  • Home
  • Blog
  • Connect From GKE Kubernetes Pod To GCE VM Instance
Connect From GKE Kubernetes Pod To GCE VM Instance

Connect From GKE Kubernetes Pod To GCE VM Instance

If you want to access any Compute Engine VM instance from a POD within a K8S cluster on Google Cloud Platform, you will need to modify the firewall settings.

You can do this in two ways:

1- Add the network tag of the VM instance you are trying to reach to the target tags section of the “gke-[cluster-name + suffix]-all” rule that GKE creates by default. In my case, the tag I added was “elasticsearch-dev”.

 

2- Alternatively, you can create a rule similar to the default rule and add your own network tag. It's important to note that the "Priority" should be lower than the default rule.

Stay healthy…