且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

同一节点中同一Pod的多个实例-Kubernetes

更新时间:2023-11-22 17:01:40

仅当您使用hostPorthostNetwork时,不同Pod的端口才可能发生冲突.否则,在同一节点上运行多个相同的Pod时,您不会遇到任何问题.

Ports of different pods may collide only if you use hostPort or hostNetwork. Otherwise, you shouldn't encounter any issues while running multiple identical pods in the same node.

您可以尝试运行以下命令.您的Wildfly吊舱应该可以正常运行,因为它们使用的端口位于容器内部.

You can just try to run the following commands. Your Wildfly pods should run without any issues because the ports they use are inside the containers.

kubectl run wildfly --image=jboss/wildfly
kubectl run wildfly-2 --image=jboss/wildfly
kubectl run wildfly-3 --image=jboss/wildfly

如果您需要使用hostPorthostNetwork(不建议使用),那么您就一个人在这里,您需要编排"该文件.端口自己.

If you need to use hostPort or hostNetwork (which is not recommended), then you're on your own here, and you need to "orchestrate" ports on your own.