I need to access the POD in GKE through the k8s service name on Batch.
Can I access it by opening the VPC between Batch and GKE? If not, how can I do it.
Batch and k8s service name are in the same project and region.
Solved! Go to Solution.
If your connection is via the DNS name of your service name then you can use this link[1] as a guide. But if the connection is through exposing the pod through implementation of service then this link[2] can guide you.
[1]https://cloud.google.com/kubernetes-engine/docs/concepts/service-discovery
[2]https://cloud.google.com/kubernetes-engine/docs/concepts/service
Hi,
Can you provide the information from these question below:
1. When you mentioned open from VPC, is this by creating a firewall rule?
2. How did you configure your batch? Is there any documentation you follow? If yes, can you please share it.
3. These resources you mentioned are from the same cluster or different cluster?
4. These resources you have mentioned, are they from the same VPC network?
From these questions I just want to know the diagram of your resources and will help us by providing more information.
Hi, @VannGuce
1. yes
2. yes,I create Batch through Google Batch documentation,The link is as follows:
3. I think they belong to different clusters. Google Batch is just a GCE, and when creating it, you cannot specify a cluster
4. yes
Thanks for sharing this information. I have found a link[1] that might be similar to your concern wherein your GKE pod needs to connect to GCE. Another troubleshooting we can do is perform a connectivity test. The result of the connectivity test will give us great information for this concern, you can follow this link[2] as a guidance. You can also try to open the port needed for this setup by creating a firewall rule[3]
[1]https://stackoverflow.com/questions/51542140/gke-pod-connect-to-external-vm-in-same-subnet
[2]https://cloud.google.com/vpc/docs/ts-vm-vm-internal#check-firewall-rules
[3]https://cloud.google.com/filestore/docs/configuring-firewall
Hi, @VannGuce
thank you for your reply,I read the question in the first link. I am just the opposite of him. My question is that I want to connect to the pod in the GKE cluster from GCE through the service name of k8s. Is it possible?
If your connection is via the DNS name of your service name then you can use this link[1] as a guide. But if the connection is through exposing the pod through implementation of service then this link[2] can guide you.
[1]https://cloud.google.com/kubernetes-engine/docs/concepts/service-discovery
[2]https://cloud.google.com/kubernetes-engine/docs/concepts/service