<p>I started working on kubernetes. I already worked with single container pods. Now i want to working on multiple container pod. i read the statement like </p>

<blockquote>
  <p>if an application needs several containers running on the same host, why not just make a single container with everything you need?</p>
</blockquote>

<p>means two containers with single IP address. My dought is, in which cases two or more containers uses same host?</p>

<p>Could you please anybody explain me above scenario with an example? </p>

BSG
<p>This is called "multiple processes per container". 
<a href="https://docs.docker.com/config/containers/multi-service_container/" rel="nofollow noreferrer">https://docs.docker.com/config/containers/multi-service_container/</a></p>

<p>t's discussed on the internet many times and it has many gotchas. Basically there's not a lot of benefit of doing it.</p>

<p>Ideally you want container to host 1 process and its threads/subprocesses.</p>

<p>So if your database process is in a crash loop, let it crash and let docker restart it. This should not impact your web container.</p>

<p>Also putting processes in separate containers lets you set separate memory/CPU limits so that you can set different limits for your <em>web</em> container and <em>database</em> container.</p>

<p>That's why Kubernetes exposes POD concept which lets you run multiple containers in the same namespace. Read this page fully: <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/pods/pod/</a></p>
