[英]Non-invasive UDP Multicast on Kubernetes
I have a (working) test program that sends and receives messages across UDP multicast. 我有一个(正在运行的)测试程序,该程序通过UDP多播发送和接收消息。 I've successfully deployed it to kubernetes cluster and demonstrated two pods communicating with one another.
我已成功将其部署到kubernetes集群,并演示了两个Pod相互通信。 The only catch with this is that I need to add
hostNetwork: true
to the pod specs. 唯一需要注意的是,我需要添加
hostNetwork: true
到pod规格。 As I understand it, this disables all the network virtualization that would otherwise be available. 据我了解,这会禁用所有原本可用的网络虚拟化。 I've also tried
我也尝试过
- containerPort: 12345
hostPort: 12345
protocol: UDP
but when I use that without hostNetwork
communication fails. 但是当我在没有
hostNetwork
情况下使用它时,通信失败。
Is there a way to get this working whilst still being able to use the normal network for everything else? 有没有办法在仍然可以使用正常网络进行其他所有工作的同时使此工作正常进行? (We're unlikely to want to switch network layer to something like Weave.)
(我们不太可能希望将网络层切换到Weave之类。)
Using hostNetwork: true
is good when you expect to get direct access from the nested pod to the Node network interface, however it brings some restrictions when you have application hosted on a few Nodes, because every time Kubernetes restarts the Pod, it can be spun on different Node as a result IP address for your application might be changed. 使用
hostNetwork: true
可以在您希望从嵌套的pod到Node网络接口直接访问的hostNetwork: true
下很好,但是当您将应用程序托管在几个Node上时会带来一些限制,因为每次Kubernetes每次重新启动Pod都可以旋转因此,您的应用程序的IP地址可能会在其他节点上更改。 Moreover, using hostNetwork
makes some problem with port collisions when you are planning to scale your application within Kubernetes cluster and therefore not recommended to implement when you are bootstrapping Kubernetes cluster on Cloud environments. 此外,当您计划在Kubernetes集群内扩展应用程序时,使用
hostNetwork
端口冲突hostNetwork
一些问题,因此,当您在Cloud环境中引导Kubernetes集群时,建议不要实施该协议。
If you wouldn't consider using overlay network for Pods communication as a significant part of Cluster Networking model, then you can lose some essential benefits like DNS resolving feature ( CoreDNS , Kube-DNS ). 如果您不打算将覆盖网络用于Pod通信作为群集网络模型的重要组成部分,那么您可能会失去一些基本好处,例如DNS解析功能( CoreDNS , Kube-DNS )。
I suppose you can try to use NodePort
as a Service object. 我想您可以尝试使用
NodePort
作为服务对象。 Due to the fact that NodePort
service proxies target application port on the corresponded Node it might be worth to check if it fits your requirement, however I don't know anything about your application deployment composition and network specification for a more advanced solution. 由于
NodePort
服务代理将目标节点上对应的应用程序端口作为目标,因此可能值得检查它是否符合您的要求,但是对于更高级的解决方案,您对应用程序部署的组成和网络规范一无所知。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.