Kubernetes 需要分配真实 IP 地址吗?
Does Kubernetes need to assign real IP addresses?
我正在尝试了解 Kubernetes 及其背后的工作原理。据我了解,每个 pod 都有自己的 IP 地址。我不确定那是哪种 IP 地址。
这是我公司的网络管理员需要传递的东西吗?或者是一种在整个网络上不可寻址的内部 IP 地址?
我已阅读有关网络覆盖(如 Project Calico)的信息,我认为它们在其中发挥了作用,但我似乎找不到解释该连接的页面。 (我觉得我的问题对互联网来说太补救了。)
Pod 的 IP 地址是否是我网络上的完整 IP 地址(就像虚拟机那样)?
Kubernetes Pods 将收到一个真实的 IP 地址,就像 Docker 由于 brdige 网络接口发生的情况一样:真正的硬东西要理解的基本上是不同节点之间的 Pod 到 Pod 连接,这是在 iptables/nftables/IPVS 的帮助下通过 kube-proxy
执行的 黑魔法 (根据您的组件)在节点中重新 运行).
关于分配给 ClusterIP 类型的 Service 的 IP 地址的不同故事:实际上,它是 Virtual IP 使用的根据需要透明地重定向到端点。
Kubernetes 网络可能看起来难以理解,但我们很幸运,因为 Tim Hockin 提供了一个非常好的演讲,名为 Life of a Packet,它将让您清楚地了解它是如何工作的。
Kubernetes 集群
Is the IP address of a Pod a full IP address on my network (just like a Virtual Machine would have)?
Kubernetes 的问题在于它不是 服务,例如一个虚拟机,但是一个集群,它有自己的网络功能和管理,包括IP地址分配和网络路由.
您的节点可能是虚拟机或物理机,但它们已在 NodeController 中注册,例如用于健康检查,最常用于 IP 地址管理。
The node controller is a Kubernetes master component which manages various aspects of nodes.
The node controller has multiple roles in a node’s life. The first is assigning a CIDR block to the node when it is registered (if CIDR assignment is turned on).
IP地址管理
Kubernetes 网络依赖于您的集群正在使用的容器网络接口 (CNI) 插件。
A CNI plugin is responsible for ... It should then assign the IP to the interface and setup the routes consistent with the IP Address Management section by invoking appropriate IPAM plugin.
通常为每个节点分配一个 CIDR 范围的 IP 地址,然后节点将其分配给在节点上安排的 pods。
GKE network overview 很好地描述了它在 GKE 上的工作方式。
Each node has an IP address assigned from the cluster's Virtual Private Cloud (VPC) network.
Each node has a pool of IP addresses that GKE assigns Pods running on that node (a /24 CIDR block by default).
Each Pod has a single IP address assigned from the Pod CIDR range of its node. This IP address is shared by all containers running within the Pod, and connects them to other Pods running in the cluster.
Each Service has an IP address, called the ClusterIP, assigned from the cluster's VPC network.
我正在尝试了解 Kubernetes 及其背后的工作原理。据我了解,每个 pod 都有自己的 IP 地址。我不确定那是哪种 IP 地址。
这是我公司的网络管理员需要传递的东西吗?或者是一种在整个网络上不可寻址的内部 IP 地址?
我已阅读有关网络覆盖(如 Project Calico)的信息,我认为它们在其中发挥了作用,但我似乎找不到解释该连接的页面。 (我觉得我的问题对互联网来说太补救了。)
Pod 的 IP 地址是否是我网络上的完整 IP 地址(就像虚拟机那样)?
Kubernetes Pods 将收到一个真实的 IP 地址,就像 Docker 由于 brdige 网络接口发生的情况一样:真正的硬东西要理解的基本上是不同节点之间的 Pod 到 Pod 连接,这是在 iptables/nftables/IPVS 的帮助下通过 kube-proxy
执行的 黑魔法 (根据您的组件)在节点中重新 运行).
关于分配给 ClusterIP 类型的 Service 的 IP 地址的不同故事:实际上,它是 Virtual IP 使用的根据需要透明地重定向到端点。
Kubernetes 网络可能看起来难以理解,但我们很幸运,因为 Tim Hockin 提供了一个非常好的演讲,名为 Life of a Packet,它将让您清楚地了解它是如何工作的。
Kubernetes 集群
Is the IP address of a Pod a full IP address on my network (just like a Virtual Machine would have)?
Kubernetes 的问题在于它不是 服务,例如一个虚拟机,但是一个集群,它有自己的网络功能和管理,包括IP地址分配和网络路由.
您的节点可能是虚拟机或物理机,但它们已在 NodeController 中注册,例如用于健康检查,最常用于 IP 地址管理。
The node controller is a Kubernetes master component which manages various aspects of nodes.
The node controller has multiple roles in a node’s life. The first is assigning a CIDR block to the node when it is registered (if CIDR assignment is turned on).
IP地址管理
Kubernetes 网络依赖于您的集群正在使用的容器网络接口 (CNI) 插件。
A CNI plugin is responsible for ... It should then assign the IP to the interface and setup the routes consistent with the IP Address Management section by invoking appropriate IPAM plugin.
通常为每个节点分配一个 CIDR 范围的 IP 地址,然后节点将其分配给在节点上安排的 pods。
GKE network overview 很好地描述了它在 GKE 上的工作方式。
Each node has an IP address assigned from the cluster's Virtual Private Cloud (VPC) network.
Each node has a pool of IP addresses that GKE assigns Pods running on that node (a /24 CIDR block by default).
Each Pod has a single IP address assigned from the Pod CIDR range of its node. This IP address is shared by all containers running within the Pod, and connects them to other Pods running in the cluster.
Each Service has an IP address, called the ClusterIP, assigned from the cluster's VPC network.