同一节点中同一Pod的多个实例-Kubernetes [英] Multiple instance of same pod in same node - Kubernetes

查看:543
本文介绍了同一节点中同一Pod的多个实例-Kubernetes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Kubernetes的同一节点中运行同一Pod的多个实例.我为此使用了一个wildfly docker映像.在同一节点中运行多个pod时,出现端口冲突异常.

I want to run multiple instances of same pod in the same node in the Kubernetes. I am using a wildfly docker image for this. When running more than one pod in the same node, I am getting port conflict exception.

2020-11-30 15:53:17,079 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("core-service" => "management"),
("management-interface" => "http-interface")
]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.management.http.extensible" => "java.net.BindException: Address already in use /0.0.0.0:9990"}}
2020-11-30 15:53:17,259 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "undertow"),
("server" => "default-server"),
("http-listener" => "default")
]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.undertow.listener.default" => "Address already in use /0.0.0.0:9575"}}
2020-11-30 15:53:17,260 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "undertow"),
("server" => "default-server"),
("https-listener" => "https")
]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.undertow.listener.https" => "Address already in use /0.0.0.0:8553"}}
2020-11-30 15:53:17,262 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("core-service" => "management"),
("management-interface" => "http-interface")
]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.management.http.extensible" => "java.net.BindException: Address already in use /0.0.0.0:9990"}}
2020-11-30 15:53:17,399 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment demo.war (runtime-name: demo.war) in 133ms
2020-11-30 15:53:17,416 ERROR [org.jboss.as.server] (ServerService Thread Pool -- 44) WFLYSRV0021: Deploy of deployment "demo.war" was rolled back with the following fai
lure message: undefined  

那么我该如何绕过此问题并在没有端口限制的情况下运行多个实例?

So how can i bypass this issue and run multiple instances without port conflits??

推荐答案

仅当您使用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.

这篇关于同一节点中同一Pod的多个实例-Kubernetes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆