Plain Flask server vs UWSGI based server on K8s for production?

4/20/2020

I have a Flask app (that talks to a PostgreSQL DB via SQLAlchemy), that needs to be dockerized and deployed to production on a K8s cluster.

However, there are 2 options to achieve this:

1) Directly running the Flask app inside the containers with threaded mode enabled (This seems to be reasonably working fine) 2) Putting the Flask app behind a UWSGI app server and nginx as a reverse proxy.

Is there any reason as to why either of them are OK / not OK for deploying the app on production, given the K8s horizontal pod autoscaler can be leveraged to for scaling up if required.

NB: I am expecting a load of atleast 10-15 requests per second on the app.

-- Azharullah Shariff
flask
kubernetes
uwsgi

0 Answers