Reputation: 291
I have read a lot of kubernetes documents but couldn't get a answer. In kubernetes architecture the basic component is a pod. Why did it make an abstraction layer over container to create a pod and manage it rather than managing the container directly. What are the main advantages kubernetes gets by managing pod rather than an container.
what is the task of the wrapper over the container ?
Upvotes: 3
Views: 909
Reputation: 6451
I think in officail documentation Understanding pod have a nice description about
Pods in a Kubernetes cluster can be used in two main ways:
Pods that run a single container. The “one-container-per-Pod” model is the most common Kubernetes use case; in this case, you can think of a Pod as a wrapper around a single container, and Kubernetes manages the Pods rather than the containers directly.
Pods that run multiple containers that need to work together. A Pod might encapsulate an application composed of multiple co-located containers that are tightly coupled and need to share resources. These co-located containers might form a single cohesive unit of service–one container serving files from a shared volume to the public, while a separate “sidecar” container refreshes or updates those files. The Pod wraps these containers and storage resources together as a single manageable entity.
If you think of Pods that run a single container then you might think maintaining container is more reasoning, but in second case Pods that run multiple containers that need to work together might face more complexity
Upvotes: 3
Reputation: 51467
The containers of a pod will always be together, and they can communicate using the loopback interface. Pods allow you to deploy closely coupled components together as separate containers. For instance, you can bundle an app and a proxy for that app that adds an encryption layer together so encrypted traffic goes in and out of the app without modifying the app container.
Upvotes: 2