kubernetes - Kubernetes 需要分配真实 IP 地址吗?

标签 kubernetes ip-address

我正在尝试了解 Kubernetes 及其背后的工作原理。据我了解,每个 pod 都有自己的 IP 地址。我不确定那是哪种 IP 地址。

这是我公司的网络管理员需要传递的东西吗?或者是一种无法在整个网络上寻址的内部 IP 地址?

我已阅读有关网络覆盖(如 Project Calico)的信息,我认为它们在其中发挥了作用,但我似乎找不到解释该连接的页面。 (我认为我的问题对互联网来说太补救了。)

Pod 的 IP 地址是否是我网络上的完整 IP 地址(就像虚拟机那样)?

最佳答案

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).

Cluster Architecture - Nodes

IP地址管理

Kubernetes 网络依赖于您的集群正在使用的容器网络接口(interface) ( 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 地址,然后节点将其分配给在该节点上调度的 pod。

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 - Kubernetes 需要分配真实 IP 地址吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58771981/

相关文章:

docker - 如何在 microk8s 中使用本地 docker 镜像?

c++ - 从 ipv4_address 构造 ip::address

php - 如何在 PHP 中获取客户端 IP 地址

c# - 从 try/catch 返回值的正确方法

networking - 有没有办法在我的本地机器上替换 127.0.0.1 以进行测试?

kubernetes - NFS卷安装在具有错误IP的Kubernetes上超时?

python - Airflow + Kubernetes Executor 资源版本太旧

kubernetes - 使用 kubectl custom-columns 获取节点状态

kubernetes - kubernetes 1.11 kube-apiserver使用所有cpu

c++ - InetPton() 将任何 IP 转换为 1.0.0.0