Pods are fundamental to Kubernetes, but are they really necessary? If Kubernetes was written from scratch so that containers were deployed directly - without wrapping pods - what would be lost?
An imaginary world without Pods
We no longer run `kubectl create pod`, rather `kubectl create container`.
There is no Pod resource, just a top-level Container resource.
Name, namespace, labels, and other attributes are only defined for containers.
ReplicaSets contain Container templates, not Pod templates
So what have we lost?
No more sidecars.
No more init containers.
No guarantee that two containers are deployed together
Common Gotchas
Pods are not used to define resource requirements. In the real world - not our imaginary world - Requests and Limits are defined on the container level, not the pod level.
As a consequence, one container can be CPU throttled but not another. Likewise, individual containers can be OOMKilled even when the pod’s memory usage is below the sum of all container limits. Â
The real purpose that Pods serve
Pods let you schedule multiple containers as an atomic unit. No more, no less.
It would be better to explain why having multiple containers as an atomic unit is important, what benefits it brings etc