<p>I am working on a project using Django on Google Kubernetes Engine and have a few questions on the best architecture format might be. Right now I have several containers in one pod because they are all dependent on each other and communicate frequently. Here is my setup:</p>

<p>Pod: webapp</p>

<p>Containers:</p>

<ul>
<li>NGINX (serves static content, sends traffic to django website)</li>
<li>website (Django, serves http responses)</li>
<li>DB Proxy (MySQL server for website and websocket server)</li>
<li>websocket (Django worker to manage websockets)</li>
<li>redis (asynchronous functionality)</li>
</ul>

<p>My plan is to create a deployment that runs several replicas and scales, but is it better to break this pod into multiple pods or a leave it as a single pod?</p>

<p>If I were to break it down, what might that architecture look like after adding in the necessary services? I'm new if this doesn't show it lol</p>

<p>It would be better for you to break these containers into multiple pods in order to scale without wasting resources. If you were to scale to for example two instances, a second instance of each container would be started. Your containers will most likely not have identical load and therefore it makes sense to only scale on the containers that are under load, hence it makes sense breaking your 1 pod into several pods. It also makes replacing individual components easier.</p>

<p>The following is an example of several pods, each running a single container. The example shows how you can scale the number of pods based on the component that is under load.</p>

<p><a href="https://i.stack.imgur.com/MZyhA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MZyhA.png" alt="Kubernetes example"></a></p>
