<p>Let's consider a python web application deployed under uWSGI via Nginx.</p>
<blockquote>
<p>HTTP client ↔ Nginx ↔ Socket/HTTP ↔ uWSGI (web server) ↔ webapp</p>
</blockquote>
<p>Where nginx is used as reverse proxy / load balancer.</p>
<p><strong>How to scale this kind of applications in kubernetes?</strong>
Several options come to my mind:</p>
<ol>
<li>Deploy nginx and uWSGI in a single pod. Simple approach.</li>
<li>Deploy nginx + uWSGI in single container? Violate the “one process per container” principle.</li>
<li>Deploy only a uWSGI (via HTTP). Omit the usage of nginx.</li>
</ol>
<p>or there is another solution, involving nginx ingress/load balancer services?</p>

guesswho
<p>It depends.</p>
<p>I see two scenarios:</p>
<ol>
<li><p><strong>Ingress is used</strong></p>
<p>In this case there's no need to have nginx server within the pod, but it can be <code>ingress-nginx</code> which will be balancing traffic across a kubernetes cluster. You can find a good example in <a href="https://github.com/nginxinc/kubernetes-ingress/issues/143#issuecomment-347814243" rel="nofollow noreferrer">this comment on GitHub issue</a>.</p>
</li>
<li><p><strong>No ingress is used.</strong></p>
<p>In this case I'd go with <code>option 1</code> - <code>Deploy nginx and uWSGI in a single pod. Simple approach.</code>. This way you can easily scale in/out your application and don't have any complicated/unnecessary dependencies.</p>
</li>
</ol>
<p>In case you're not familiar with <code>what ingress is</code>, please find <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">kubernetes documentation - ingress</a>.</p>
