如何解决minikube cluster-pod中的容器无法发送/接收UDP数据包
我正在minikube-cluster节点内的pod中运行多个容器。容器内的容器正尝试使用“ 127.0.0.1”和相应的容器端口交换UDP数据包。其中一个容器应侦听输入端口,处理传入的UDP数据包,然后使用传出端口将其转发到另一个容器。但是,我无法从任何这些容器中接收/发送任何数据包。 我想知道以下代码部分是否有任何错误。非常感谢您的提前配合。
service.yaml:
apiVersion: v1
kind: Service
...
spec:
type: NodePort
ports:
- protocol: UDP
port: 5001
nodePort: 30003
- protocol: UDP
port: 5002
nodePort: 30004
deployment.yaml:
- name: abc
image: abc
ports:
- containerPort: 5001
- containerPort: 5002
C#数据包发送器:
SendingEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"),5001);
UdpClient Sender = new UdpClient();
Sender.Send(Buffer,Buffer.Length,SendingEndPoint);
C#数据包接收器:
Receiver = new UdpClient(IPAddress.Parse("127.0.0.1"),5001);
Receiver.BeginReceive(new AsyncCallback(Handler),Receiver);
.....
Handler_funcation()
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。