10

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.

Bruno Bronosky
  • 4,529
  • 3
  • 26
  • 34
  • If you are that short of resources, you needed the new node anyway, and likely two new nodes. – Michael Hampton Oct 19 '16 at 15:48
  • 2
    Down voting a question because the answer is "No" is not the Stack Exchange culture. If you would have answered the question, I would have chosen it as "the answer". I didn't ask for a solution to a need. I asked for clarification on a feature that was [at best] merely implied. My intent was to have the answer explicitly laid out in terms that would turn up in Google searches. – Bruno Bronosky Oct 19 '16 at 18:53
  • No, but downvoting for not reading the documentation is very much a Stack Exchange thing. I wasn't going to downvote you, but ... you didn't read [the documentation](http://kubernetes.io/docs/user-guide/pods/). – Michael Hampton Oct 19 '16 at 19:25
  • 3
    It always amazes me how people can conclude that someone didn't read documentation. It was actually after reading that exact page that I posted this question. Specifically the first paragraph of "What is a pod?" And I stated that the feature was implied by the documentation. And I linked to 1 article that I had researched beyond reading the documentation. So no, I did not fail to read the documentation. I just felt that [co-location](https://en.wikipedia.org/wiki/Co-location_(satellite)) had enough [ambiguity](https://en.wikipedia.org/wiki/Colocation) that it should be clarified. – Bruno Bronosky Oct 19 '16 at 21:34
  • 1
    You didn't demonstrate that you were even aware that the documentation existed. Now you have, and so I've removed my downvote. – Michael Hampton Oct 20 '16 at 02:39
  • "The reason I'm asking is that it seems like Kubernetes is inherently wasteful if this is true." As far as I understand kubernetes way of allocating resources, this only seems to be the case if you specify exactly how much CPU + Ram a pod needs. But if a worker node has nothing to do, it will not hold resources, meaning they are available for other nodes. Could be wrong about it though... – goulashsoup Aug 10 '23 at 11:56

1 Answers1

14

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.

  • 2
    I appreciate this answer. I wasn't sure if co-location was used in the same way [as in satelites](https://en.wikipedia.org/wiki/Co-location_(satellite)) which would be in the same Cluster, but not necessarily on the same Node. I think this (lack of configurability) is actually a weakness of Pods. I can see a desire to have a unit that you want to share the same fate, but not the same Node. Some Pods would be more expensive to run on a single Node than if the containers were on smaller Nodes. – Bruno Bronosky Oct 19 '16 at 21:43
  • 1. Link to your "critique of pods" is down. 2. What about [this](https://stackoverflow.com/a/64385099/5233188)? There is says you can "assign multiple nodes to a pod." Was that feature added after your answer? – goulashsoup Aug 10 '23 at 11:51
  • Concerning 1: the link https://medium.com/@mhausenblas/why-pods-are-useless-and-i-still-might-want-to-have-them-1901f58c6056 work, not sure what re-redirect drama is going on, and 2. forcing pods (of a deployment, daemonset, etc.) onto certain nodes is not the same as "splitting" a pod. By definition, a pod is on a single node. – Michael Hausenblas Aug 10 '23 at 16:00