从Appengine连接到Google Containers的Kubernetes服务 [英] Connect from Appengine to a Kubernetes service from Google Containers

查看:90
本文介绍了从Appengine连接到Google Containers的Kubernetes服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含Appengine部分和Google Containers集群的项目. Appengine应用程序需要对部署到Google Containers的服务进行http调用.

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.

我知道我可以为该服务分配一个外部IP,将其硬编码到我的Appengine应用中,然后再次向UrlFetch请求该IP.那个有效.但我不想使用公共网络进行此类通信.

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.

我想知道也许我也可以像在Pods之间的Kubernetes集群中那样获得访问权限吗?通过指定服务主机名,该主机名解析为10.x.x.x范围内的内部IP.

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.

是否可以通过Appengine进行相同操作?有GKE服务可解析的特殊命名架构吗?

Is it possible to do same from Appengine? is there a special naming schema resolvable to GKE services?

推荐答案

当前没有一种方法可以将来自App Engine应用程序的数据包注入运行Kubernetes集群的私有GCP网络(例如,来自10.0的网络). 0.0/8地址).因此,将应用程序连接到Container Engine服务的唯一方法是使用外部IP(如您当前所做的那样).

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).

这篇关于从Appengine连接到Google Containers的Kubernetes服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆