如何在Ingress Nginx中设置RTMP协议?
我在Google Kubernetes引擎上设置了一个Kubernetes群集。我有一个托管RTMP应用程序的POD。该应用程序需要两个端口,一个用于HTTP,一个用于RTMP。我已经设置了一个入口nginx负载平衡器。它正确路由HTTP流量。我也希望能够路由RTMP流量。但是,当我在yaml文件中编写RTMP时。它显示为一个未知领域。我正在使用Skaffold和Google Cloud Build进行部署。
Ingress-SRV文件,就是在端口1935上有一个RTMP的条目。然后,我可以使用RTMP协议来传输爱情视频。
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-service
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: 'true'
spec:
rules:
- http:
paths:
- path: /?(.*)
backend:
serviceName: stream-server-srv
servicePort: 8000
这是我想完成的
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RTMP是基于TCP的协议,标准入口不支持TCP服务。
Nginx Ingress Controller(看起来您正在使用)可以被配置为公开TCP服务。
首先,您需要确保在
stream> stream-server-srv
服务中同时公开HTTP和RTMP端口:(用命名空间替换默认值)
您还需要确保也暴露了1935年端口。例如:
最后,您需要更新/修补nginx TCP服务配置:(
用命名空间/serviceName替换“默认/stream-server-srv”)
RTMP is a TCP-based protocol and standard Ingress does not support TCP services.
The NGINX Ingress controller (which it looks like you are using) can be configured to expose TCP services.
First, you'll need to make sure that you expose both the HTTP and RTMP ports in your
stream-server-srv
Service:(replace default with your namespace)
You will also need to make sure that the Service used to expose the NGINX ingress exposes port 1935 as well. For example:
Finally, you'll need to update / patch the NGINX tcp services ConfigMap:
(replace "default/stream-server-srv" with your namespace/servicename)