Deploy Django into Production with Kubernetes, Docker, & Github Actions. Complete Tutorial Series

preview_player
Показать описание
Learn how to deploy a production-ready Django application into a Kubernetes cluster.

Kubernetes is a tool to manage containers. This type of management is called orchestration because it does more than just manage the containers such as it will scale up and scale down resources as needed (among many other things).

Since Kubernetes is a massive tool, we're going to be covering a practical implementation using a Docker-based Django application.

Django is a way to build web applications rapidly using Python. There are many ways to get Django into production so the question is why use K8S at all? There's many reasons we'll cover throughout this series but here are a few:
● 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)

Kubernetes can do a lot which makes it a great tool to learn but also a daunting one at that. To make it more approachable here's what we'll be doing:

● Start a Python Virtual Environment
● Create a bare bones production-ready Django project
● Use a managed Database service from DitgitalOcean
● Install Kubernetes Command Line tool locally (kubectl)
● Start a Kubernetes Cluster on DigitalOcean
● Provision a Deployment and Service for our Django project
● Implement Github Action Workflows to automate future deployments

▶︎ References

▶︎ Chapters

00:00:00 Welcome to Django & Kubernetes
00:02:08 Requirements & Recommendations
00:07:12 Install Kubernetes Command Line Tool Kubectl on macOS
00:12:49 Install Kubernetes Command Line Tool Kubectl on Windows
00:19:08 Create the Python Virtual Environment
00:24:28 Install Requirements & Start Django Project
00:33:01 Environment Variables with a dotenv file
00:36:10 Setup django dotenv to read our dotenv file
00:41:54 Update Django settings for Database & Environment Variables
00:47:29 Docker, Dockerfile & dockerignore
01:01:13 Create a migration script
01:09:46 Docker Compose Part 1
01:32:48 Docker Compose Part 2
01:41:43 Provision Kubernetes on DigitalOcean
01:55:20 Connect to Kubernetes with kubectl & kubeconfig
02:03:41 Deploy your First Container on Kubernetes
02:14:00 Expose your Deployment with a Load Balancer
02:26:11 Deploy a Minimal FastAPI App
02:34:24 DigitalOcean Container Registry
02:38:36 Build & Push Docker Container to DO Container Registry
02:45:08 Managed PostgreSQL Database
02:52:44 Kubernetes Secrets from env
02:57:17 Django Deployment & Service
03:11:21 Full Deployment & Fix Errors
03:24:55 Deployment Guide
03:38:57 Github Actions Test Django Automatically
03:55:31 Github Actions Build & Push Docker Container to DigitalOcean
04:11:09 Github Actions Django Deployment on Kubernetes
04:29:01 Django Static Files on DigitalOcean Spaces
04:54:28 New Django App, Models, & Tests
05:10:55 Thank you
Рекомендации по теме
Комментарии
Автор

Thank you for checking this one out! Code linked below as well as chapters -- skip around!


00:00:00 Welcome to Django & Kubernetes
00:02:08 Requirements & Recommendations
00:07:12 Install Kubernetes Command Line Tool Kubectl on macOS
00:12:49 Install Kubernetes Command Line Tool Kubectl on Windows
00:19:08 Create the Python Virtual Environment
00:24:28 Install Requirements & Start Django Project
00:33:01 Environment Variables with a dotenv file
00:36:10 Setup django dotenv to read our dotenv file
00:41:54 Update Django settings for Database & Environment Variables
00:47:29 Docker, Dockerfile & dockerignore
01:01:13 Create a migration script
01:09:46 Docker Compose Part 1
01:32:48 Docker Compose Part 2
01:41:43 Provision Kubernetes on DigitalOcean
01:55:20 Connect to Kubernetes with kubectl & kubeconfig
02:03:41 Deploy your First Container on Kubernetes
02:14:00 Expose your Deployment with a Load Balancer
02:26:11 Deploy a Minimal FastAPI App
02:34:24 DigitalOcean Container Registry
02:38:36 Build & Push Docker Container to DO Container Registry
02:45:08 Managed PostgreSQL Database
02:52:44 Kubernetes Secrets from env
02:57:17 Django Deployment & Service
03:11:21 Full Deployment & Fix Errors
03:24:55 Deployment Guide
03:38:57 Github Actions Test Django Automatically
03:55:31 Github Actions Build & Push Docker Container to DigitalOcean
04:11:09 Github Actions Django Deployment on Kubernetes
04:29:01 Django Static Files on DigitalOcean Spaces
04:54:28 New Django App, Models, & Tests
05:10:55 Thank you

CodingEntrepreneurs
Автор

I don't know many how can you post such high quality content for free. Salute.

ai.
Автор

WAAOO!!! You just did it.... Was missing this K8s thing. and finally sir you did it. Thanks a lot.

danielkamau
Автор

I am stoked!!! Started looking into kubernetes recently... Glad to be subscribed to your channel. You just saved me loads of hustle

joshqcophie
Автор

I'm a subscriber since 2019, It's unbelievable how informatic your channel is! Great Content Great Mastery. You have no idea how many times your channel just saved my a**! Especially this one! I mean someone with a good portion of time can individually start a startup just by watching your videos!

benyaminaghaebrahimi
Автор

Once I get a job i will purchase subscription for sure. This is brutal free content. Life saver.

tarekahmed
Автор

I am truly impressed. I've been working as a software engineer for two years, and this tutorial is unbelievable!

yahyamlaouhi
Автор

I finally found the time to go over this material, and OMG, my mind is blown away by what you are showing us. Justin, there are no words but the utmost Gratitude towards you and your teachings. I'm blown away by this material again I'm only two and a half hours in, and my mind just Exploded like confetti. I will admit the Kluster will be more expensive than Dokku, I think - but I'm anxious about seeing this lesson to the end

xzatech
Автор

Great to see you still in the game killing it

justinnoor
Автор

just randomly clicked from suggestion! but Man I Love you!!! Never found this much detailed and insane explanation. Subbed <3 !

hemalpatel
Автор

Wow thanks for doing this. Really helpful.

Brocollipy
Автор

The video was so helpful. Thank you very much.

dannypark
Автор

im in the middle of this now and i just want to say this is some dope work....i hope one day ill be able to master my skills like you sir!! kudos!

violasangut
Автор

Hey!
I know you from 2019 with Django full course for Beginners - that was a point where i've started lear python and Django.

So now because of you i know Django ) Thank you very much for your work,

edflysm
Автор

The best tutorial I've seen so far :)

skynet-software
Автор

QUALITY, this is what everyone got used to from Justin Michel. THANK YOU

eagleofsharm
Автор

This is the absolute best tutorial for a beginner like myself on how to deploy a django website onto cloud. Thank you so much. My only humble request is if you can make a video or point me in the direction of how to deploy on AWS instead of DigitalOcean?

rohitschauhanitbhu
Автор

Awesome 🎉🎉🎉🎉🎉… after a very long time saw some end to end implementation with complete application development lifecycle with Devops implementation

sumitsrivastava
Автор

I don't know why your YouTube is growing slowly, you are the best

johnnwabuforudemezue
Автор

Would've been a lifesafer 2 weeks back when I was ramming my head deploying an application at work, anyway thanks and keep up the good work!

animeshsingh