I have a project with Appengine part and Google Containers cluster. Appengine app needs to make http calls to a Service deployed to Google Containers.
I know that I can assign an external IP to the Service, hardcode it into my Appengine app, and then make UrlFetch requests agains such IP. That works. But I don't want to use public network for such communication.
I wondering maybe I can also get access like it's done inside Kubernetes cluster between Pods? by specifying a service host name, that resolves to an internal IP in 10.x.x.x range.
Is it possible to do same from Appengine? is there a special naming schema resolvable to GKE services?
Ways to connect You have several options for connecting to nodes, pods and services from outside the cluster: Access services through public IPs. Use a service with type NodePort or LoadBalancer to make the service reachable outside the cluster. See the services and kubectl expose documentation.
In case you want to access an external service, you need to: create a Service without any selector - Kubernetes will NOT create an Endpoints object. manually create the Endpoints resource corresponding to your Service (with the same name) and IP/port of the service you want to access.
Kubernetes builds on 15 years of running Google's containerized workloads and the valuable contributions from the open source community. Inspired by Google's internal cluster management system, Borg, Kubernetes makes everything associated with deploying and managing your application easier.
There isn't currently a way to inject packets from an App Engine application into the private GCP network where your Kubernetes cluster is running (e.g. coming from a 10.0.0.0/8 address). So the only way to connect your application to your Container Engine service is to use the external IPs (as you are currently doing).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With