从Google Dataflow访问在GKE中运行的HTTP服务 [英] Access HTTP service running in GKE from Google Dataflow

查看:73
本文介绍了从Google Dataflow访问在GKE中运行的HTTP服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在谷歌容器引擎集群上运行的HTTP服务(在kubernetes服务的后面).

I have an HTTP service running on a Google Container Engine cluster (behind a kubernetes service).

我的目标是使用固定名称从运行在同一GCP项目上的Dataflow作业访问该服务(以相同的方式,可以使用DNS从GKE内部访问服务).有什么主意吗?

My goal is to access that service from a Dataflow job running on the same GCP project using a fixed name (in the same way services can be reached from inside GKE using DNS). Any idea?

  • 我在stackoverflow上阅读的大多数解决方案都依赖于在试图获得服务的机器上安装kube-proxy.据我所知,不可能在Dataflow创建的每个工作程序实例上可靠地设置该服务.
  • 一种选择是创建一个外部平衡器,并在公共DNS中创建一个A记录.尽管可以,但是我宁愿在指向该服务的公共DNS记录中也没有条目.

推荐答案

在GCP上运行的数据流作业将不属于Google容器引擎群集,因此默认情况下将无法访问内部群集DNS.

The Dataflow job running on GCP will not be part of the Google Container Engine cluster, so it will not have access to the internal cluster DNS by default.

尝试设置 ://cloud.google.com/container-engine/docs/load-balancer"rel =" nofollow>负载均衡器,用于您要公开的服务,该服务知道如何将外部"流量路由到它.这样一来,您就可以直接从在GCP上执行的Dataflow作业连接到IP地址.

Try setting up a load balancer for the service that you want to expose which knows how to route the "external" traffic to it. This will allow you to connect to the IP address directly from a Dataflow job executing on GCP.

这篇关于从Google Dataflow访问在GKE中运行的HTTP服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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