[英]Difference between container port,host port and service port in dcos json in portMappings
我對所有這些端口在portMappings中表示容器端口,主機端口和服務端口感到困惑,以下是我的json
"portMappings": [
{
"containerPort": 9000,
"hostPort": 9000,
"labels": {
"VIP_0": "/app2n:9000"
},
"protocol": "tcp",
"servicePort": 10101
}
]
containerPort
是containerPort
中的端口,您的容器化應用應偵聽該端口, hostPort
是在運行容器的Mesos代理上可見的端口, servicePort
是框架內部使用的抽象端口,例如,它可以在loadbalancer中用作映射到運行容器的主機及其hostPort
端口。 在整個集群中應該是唯一的。 基本上流看起來像這樣:互聯網-> <loadbalancer eg nginx, haproxy>:<servicePort>
-> <mesos agent on which container runs>:<hostPort>
-> <container>:<containerPort>
targetPort這是請求發送到的Pod上的端口。 您的應用程序需要在此端口上偵聽網絡請求才能使服務正常工作。 這些端口通常用於服務yaml描述符中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.