在 kubernetes 中,POD 将具有 IP 地址,而 Node 将具有 IP 地址

In kubernetes POD will have IP address and Node will have IP address

在 kubernetes 中,POD 将具有 IP 地址,Node 将具有 IP 地址。

我知道我们使用 POD IP 地址通过容器端口访问其中的容器。我们是否出于任何目的使用节点 IP? 此外,kubernetes 会负责为 pods.

创建 IP 地址

Kubernetes 网络插件创建一个单独的 pod 网络(calico、flannel、waeve 等)

Pods 从该 pod 网络分配 IP

一个 pod 中的所有容器都具有相同的 IP 地址,因为网络命名空间是共享的

NodeIP 可用于从外部系统访问 pod 上的服务运行,例如,如果您使用类型为 Nodeport 的 kubernetes 服务公开服务,或使用入口资源公开服务

更多:

Every Pod is allocated an IP address, and the CNI plug-in is responsible for its allocation and assignment to a Pod. You may be asking yourself, “If a Pod can have multiple containers, how does the CNI know which one to connect?” If you have ever interrogated Docker to list the containers running on a given Kubernetes node, you may have noticed a number of pause con‐ tainers associated with each of your Pods. These pause containers do nothing meaningful computationally. They merely serve as pla‐ ceholders for each Pod’s container network. As such, they are the first container to be launched and the last to die in the life cycle of an individual Pod