-
Couldn't load subscription status.
- Fork 90
Description
We have a WIP pull request to containerize mygpo for a local development environment - #32
Containerization is a relatively massive undertaking that requires weeks, if not months of effort. We'll take a progressive approach to bring containers onto our production environment.
We will migrate our production environment to a containerized solution before addressing at least the following issues:
- Local development environment
- Continuous integration
- Application migration from vanilla Linux servers to containers
- Deployment strategy (e.g., rolling updates)
For the moment our server setup on prgmr.com is below:
- App server for our Nginx, Gunicorn, Django app - 4 vCPUs, 4 GB memory.
- Database server for our PostgreSQL - 4 vCPUs, 2 GB memory.
The database server is not our primary target for now because we rarely upgrade the database while we regularly deploy the latest master codebase to the app server. Database containerization is much more complicated than stateless web applications. Fortunately, I don't see any direct benefit of a database container for us.
A single app server might not be ideal. As you may know, Kubernetes requires at least three servers for high availability. Meanwhile, lightweight Kubernetes variants focusing on single-node deployment like k8s might be helpful. We might also ask for more resources from prgmr.com or other cloud providers.
For more info about lightweight Kubernetes: K3s, minikube or microk8s? : kubernetes
Why container orchestration?
There are many benefits to enumerate, all of which boil down to smooth application deployment. Our existing infrastructure has many moving parts, so the deployment is error-prone. I have deployed an update last week and caused a half-an-hour outage because of Gunicorn misconfiguration. Not cool; my fault 😔.
Why Kubernetes?
- I'm not opposed to Docker Swarm and others. I'm inclined to use Kubernetes because I have used Kubernetes but don't know much about Swarm.
- Although Kubernetes is well-known for its steep learning curve while Swarm is relatively more accessible for new-comers, the main difficulty is on the cluster setup. For development uses the cluster choice is less critical. Kubernetes also has easy-to-use local development variants like Minikube.
- Kubernetes has good documentation and comes with many out-of-box solutions.
- There are many managed Kubernetes cloud providers, which is great if we want to relieve the burden of administration and maintenance in the future.