简体   繁体   English

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

[英]In kubernetes POD will have IP address and Node will have IP address

In kubernetes POD will have IP address and Node will have IP address. 在kubernetes中,POD将具有IP地址,而Node将具有IP地址。

I know we use POD IP address for accessing the containers in it with containers port. 我知道我们使用POD IP地址通过容器端口访问其中的容器。 Do we use Node IP for any purpose? 我们是否出于任何目的使用节点IP? Also Will kubernetes takes care of creating IP address for pods. Will kubernetes还将负责为Pod创建IP地址。

Kubernetes networking plugin creates a separate pod network ( calico, flannel , waeve etc) Kubernetes网络插件创建一个单独的Pod网络(印花布,法兰绒,波浪纹等)

Pods are assigned IPs from that pod network 从该Pod网络为Pod分配IP

All the containers in a pod have the same IP address since the network namespace is shared 由于网络名称空间是共享的,因此pod中的所有容器都具有相同的IP地址

NodeIP can be used to access the service running on the pod , from external systems , such as in case , you expose the service using kubernetes Service of type Nodeport , or expose the service using ingress resource NodeIP可用于从外部系统访问Pod上运行的服务,例如,如果您使用类型为Nodeport的kubernetes Service公开该服务,或使用入口资源公开该服务

More: 更多:

Every Pod is allocated an IP address, and the CNI plug-in is responsible for its allocation and assignment to a Pod. 每个Pod都分配有一个IP地址,而CNI插件负责为其分配和分配给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. 您可能会问自己:“如果Pod可以有多个容器,那么CNI怎么知道要连接哪个容器?”如果您曾经询问过Docker列出在给定Kubernetes节点上运行的容器,您可能已经注意到了许多暂停与每个Pod相关联的容器。 These pause containers do nothing meaningful computationally. 这些暂停容器在计算上没有任何意义。 They merely serve as pla‐ ceholders for each Pod's container network. 他们只是充当每个Pod容器网络的代理人。 As such, they are the first container to be launched and the last to die in the life cycle of an individual Pod 因此,它们是单个Pod生命周期中第一个要发射的容器,也是最后一个死亡的容器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM