Django & Kubernetes
- Gracefully deploy Docker-based Django projects
- Scale up (or scale down) your web apps with ease
- Use a few or a lot of microservices internally or externally
- Self-heal when services go down
- Simplify app deployment (after initial configuration)
- Streamline your backend Infrastructure (provision virtual machines and let k8s do the rest)
- Start a Python Virtual Environment
- Create a bare bones production-ready Django project
- Create a Dockerfile to describe our environment (much like this blog post)
- Use a managed Database service from DitgitalOcean
- Install Kubernetes locally
- Start a Kubernetes Cluster on DigitalOcean
- Provision a Deployment and Service for our Django project
- Implement Github Action Workflows to automate future deployments
References
- Django on Docker guide
- Docker & Docker Compose tutorial series
- Github Actions guide
- DigitalOcean $100 credit for new accounts
- Code
Lessons
Welcome to Django & K8s
2:15
Requirements & Recommendations
5:01
Install Kubernetes Command Line Tool Kubectl on macOS
5:33
Install Kubernetes Command Line Tool Kubectl on Windows
6:17
Create the Python Virtual Environment
5:17
Install Requirements & Start Django Project
8:30
Environment Variables
3:06
Setup `django-dotenv` to read `.env`:
5:41
Update Django settings for Database & Environment Variables
5:32
Docker, Dockerfile & & `.dockerignore`
13:41
Create a migration script
8:30
Docker Compose Part 1
22:59
Docker Compose Part 2
8:52
Provision Kubernetes on DigitalOcean
13:34
Use the Kubenernetes Config file: kubeconfig
8:18
Deploy your First Container on Kubernetes
10:16
Expose your Deployment with a Load Balancer
12:08
Deploy a Minimal FastAPI App
8:10
DigitalOcean Container Registry
4:09
Build & Push Docker Container to DO Container Registry
6:29
Managed Postgres Database on DigitalOcean
7:33
Kubernetes Secrets from env
4:30
Django Deployment & Service
14:01
Full Deployment & Fix Errors
13:31
Deployment Guide
13:59
Github Actions: Run Django Tests
16:31
Github Actions: Build & Push Docker Container to DigitalOcean
15:35
Github Actions: Kubernetes & DigitalOcean
17:49
Django Static Files on DigitalOcean Spaces & K8s
25:24
New Django App & Tests
16:24
Thank you & next steps
0:56