Multiple instance of same pod in same node - Kubernetes
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.
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/wildflykubectl run wildfly-2 --image=jboss/wildflykubectl run wildfly-3 --image=jboss/wildfly
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.