大网数据广告活动
服务器运维问答

Can a Kubernetes pod span nodes?

· 52CE 我爱测

The Docs say... A pod (as in a pod of whales or pea pod) is a group of one or more containers (such as Docker containers), the shared storage for those containers, and options about how to run the containers. Pods are always co-l…

问题原文

原帖链接 · Bruno Bronosky · CC BY-SA 3.0

The Docs say...

A pod (as in a pod of whales or pea pod) is a group of one or more containers (such as Docker containers), the shared storage for those containers, and options about how to run the containers. Pods are always co-located and co-scheduled, and run in a shared context. A pod models an application-specific “logical host” - it contains one or more application containers which are relatively tightly coupled — in a pre-container world, they would have executed on the same physical or virtual machine.

But I'm unsure if "co-location" means on the same P̶o̶d̶ Node. When satellites are co-located they are "in close proximity so that to reception equipment on the ground they 'appear' to occupy a single orbital position." So, that could be on the same Cluster, not on the same Node.

At the time of posting this, the only info I can find on this issue is at https://platform9.com/blog/compare-kubernetes-vs-ecs/ where it says...

Containers in a single Pod are guaranteed to run on a single Kubernetes node.

Now that sounds pretty conclusive, but I haven't been able to get any corroboration on that anywhere. I want to make sure that they are correct and didn't just misunderstand and spread misinformation.

The reason I'm asking is that it seems like Kubernetes is inherently wasteful if this is true. It is almost certain that your nodes with pods deployed will have resources left over. It is likely that you will have a pod whose needs could be satisfied by the combination of these left over resources. However, if a pod cannot span multiple nodes, you will have to create a new node and have even more un-utilized resources.

已采纳解答

原帖链接 · Michael Hausenblas · CC BY-SA 3.0

The very idea of pods is that of co-location, that is, being able to define compute-locality where it makes sense (or where it's needed). So, no, per definition, since all containers in a pod will be scheduled on the same node, a pod can not span nodes.

See also my critique of pods here. Having said that, we've introduced the pods concept in DC/OS now with v1.9 as well. There seems to be a certain demand, but my hunch (since I don't have data on it) is that it's mostly a sort of safety blanket for cases where one doesn't or can't go all in, cloud-native wise.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-10-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。