The core resource object in K8s is the Pod, which is the smallest deployable resource object managed by K8s. Many other resource objects are built upon Pods to achieve more complex application deployment and management. For example, a Deployment manages multiple Pods to ensure high availability and rolling updates of applications.
Pod Basics
A Pod contains one or more containers, and the relationship between containers and a Pod is akin to peas in a pod, which is where the name “Pod” comes from. In K8s, a Pod is a logical concept, while containers are the actual entities running the application images. So why does K8s manage Pods instead of directly managing containers?
The most important reason is that in many common application scenarios, containers are not isolated entities; they often have close relationships with other containers. These containers collaborate, start together, stop together, and provide services together. They need to communicate easily with each other and access the same data.
Therefore, K8s created the Pod as a higher-level resource object on top of containers. A Pod can group multiple containers together for deployment and…