Why using pods and not directly containers in an OpenShift V3 environment

12/3/2015

Kubernetes is an orchestration tool for the management of containers. Kubernetes creates pods which are containing containers, instead of managing containers directly.

I read this about pods

I'm working with OpenShift V3 which is using pods. But in my apps, all demo's and all examples I see: One pod contains one containers (it's possible to contain more and that could be an advantage of using pods). But in an OpenShift environment I don't see the advantage of this pods.

Can some explain me why OpenShift V3 is using kubernetes with pods and containers instead of an orchestration tool which is working with containers immediately (without pods).

--
kubernetes
openshift-origin

1 Answer

12/3/2015

There are many cases where our users want to run pods with multiple containers within OpenShift. A common use-case for running multiple containers is where a pod has a 'primary' container that does some job, and a 'side-car' container that does something like write logs to a logging agent.

The motivation for pods is twofold -- to make it easier to share resources between containers, and to enable deploying and replicating groups of containers that share resources. You can read more about them in the user-guide.

The reason we still use a Pod when only a single container is that containers do not have all the notions that are attached to pods. For example, pods have IP addresses. Containers do not -- they share the IP address associated with the pod's network namespace.

Hope that helps. Let me know if you'd like more clarification, or we can discuss on slack.

-- Paul Morie
Source: StackOverflow