是否可以在Cloud Run Service中公开5001(HTTP)和5672(TCP)端口? [英] Is it posible to expose 5001 (HTTP) and 5672 (TCP) ports in a Cloud Run Service?

查看:74
本文介绍了是否可以在Cloud Run Service中公开5001(HTTP)和5672(TCP)端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Google Cloud中设置解决方案.我需要RabbitMQ队列代理和.NET Core 2.2中开发的WebAPI.这个想法是让WebAPI连接到RabbitMQ来接收消息.

I am setting up a solution in Google Cloud. I need a RabbitMQ queue broker and a WebAPI developed in .NET Core 2.2. The idea is for the WebAPI to connect to RabbitMQ to receive messages.

我已经将带有GKE的RabbitMQ安装在具有RabbitMQ集群的kubernetes集群中,该集群是从Marketplace获得的.我已经在Cloud Run中安装了WebAPI.这两个组件均以标准方式提出,没有任何公开性要求.

I have mounted RabbitMQ with GKE in a cluster of kubernetes with RabbitMQ Cluster, obtained in Marketplace. I have mounted the WebAPI in Cloud Run. Both components are raised in a standard way, without any particularity for publication.

WebAPI使用端口5001进行HTTP通信,显然订阅RabbitMQ来接收消息的侦听器使用端口5672.

The WebAPI uses port 5001 for HTTP traffic, and apparently the listener that subscribes to RabbitMQ to receive messages uses port 5672.

问题是无法将WebAPI上传到Cloud Run,这显然是因为Cloud Run仅公开一个端口用于HTTP流量,因此另一个端口5672被阻止了.

The problem is that uploading the WebAPI to Cloud Run doesn't work, apparently because Cloud Run only exposes one port for HTTP traffic and therefore the other port, 5672, is blocked.

通过在kubernetes上的容器中安装相同的WebAPI,它确实暴露了端口5001和5672并可以正常工作.

By mounting the same WebAPI in a container on kubernetes, it does expose port 5001 and 5672 and works fine.

是否可以将WebAPI发布到Cloud Run,该Web API除了为HTTP流量公开端口5001之外,还公开端口5672(在这种情况下为打开TCP连接),从而能够连接到RabbitMQ?

Can a WebAPI be published to Cloud Run that, in addition to exposing port 5001 for HTTP traffic, also exposes port 5672 (in this case to open a TCP connection) and thus be able to connect to RabbitMQ?

推荐答案

否.

Cloud Run(受完全管理)始终通过HTTPS在单个端口(位于:443)上公开服务.

Cloud Run (fully managed) always exposes services a single port (on :443) over HTTPS.

这篇关于是否可以在Cloud Run Service中公开5001(HTTP)和5672(TCP)端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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