简体   繁体   English

从app引擎连接到kubernetes引擎

[英]Connect to kubernetes engine from app engine

We want to use an app engine flexible process to update our ElasticSearch index, which is on Google Kubernetes Engine. 我们希望使用应用程序引擎灵活的流程来更新我们的ElasticSearch索引,该索引位于Google Kubernetes Engine上。 We need to connect to ElasticSearch via a http(s) address. 我们需要通过http(s)地址连接到ElasticSearch。 What's the recommended way to do this? 建议的方法是什么? We don't want to expose the cluster to the external networks since we don't have authentication in front of it. 我们不希望将群集暴露给外部网络,因为我们之前没有身份验证。

I've seen this SO post but both k8s and AE have changed a lot in the 2 years since the question/answer. 我已经看过这个SO帖子,但是问题/答案后的2年内k8s和AE都发生了很大的变化。

Thanks for your help! 谢谢你的帮助!

The post you linked to was about App Engine Standard. 您链接的帖子是关于App Engine Standard的。 App Engine Flex is built on top of the same Google Cloud networking that is used by Google Compute Engine virtual machines and Google Kubernetes Engine clusters. App Engine Flex构建于Google Compute Engine虚拟机和Google Kubernetes Engine群集所使用的相同Google Cloud网络之上。 As long as you put the App Engine flex application into the same VPC as the Google Kubernetes Engine cluster you should be able to communicate between them using internal networking. 只要您将App Engine Flex应用程序放入与Google Kubernetes Engine集群相同的VPC中,您就应该能够使用内部网络在它们之间进行通信。

On the other hand, to expose a Kubernetes service to anything running outside of the cluster will require you to modify the service for Elastic search because by default Kubernetes services are only reachable from inside of the cluster (due to the way that the service IPs are allocated and reached via IPTables magic). 另一方面,要将Kubernetes服务公开给在集群外部运行的任何内容,将要求您修改Elastic搜索服务,因为默认情况下Kubernetes服务只能从集群内部访问(由于服务IP的方式是通过IPTables魔术分配并达成)。 You need to "expose" the service, but rather than exposing it to the internet via an external load balancer, you expose it to the VPC using an internal load balancer. 您需要“公开”该服务,但不是通过外部负载平衡器将其公开到Internet,而是使用内部负载平衡器将其公开给VPC。 See https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing . 请参阅https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing

in addition to Robert's answer, make sure that app engine and GKE are in the same region, because Internal load balancers are not usable from other region. 除了Robert的答案之外,请确保app引擎和GKE位于同一区域,因为内部负载均衡器不能从其他区域使用。

check this https://issuetracker.google.com/issues/111021512 请查看此https://issuetracker.google.com/issues/111021512

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM