Day 88 (Project-9): Deploying Django Todo App on AWS EC2 with Kubernetes ๐
Project Description ๐
In this project, we embark on deploying a Django Todo application on AWS EC2 utilizing a Kubeadm Kubernetes cluster. Kubernetes Cluster aids in auto-scaling and auto-healing, enhancing the reliability and scalability of our application.
Introduction ๐
Greetings, fellow enthusiasts! Today, let's delve into the realm of cloud-native deployment by orchestrating our Django Todo app with Kubernetes on AWS EC2. Let's dive into the details and witness the magic unfold!
Task-01: Kubernetes Cluster Setup on AWS EC2 ๐ ๏ธ
Launch an EC2 instance on AWS.
Set up a Kubernetes cluster using Kubeadm following the provided guide.
https://github.com/LondheShubham153/kubestarter/blob/main/kubeadm_installation.md
Verify connectivity between worker and master nodes.
Deployment and Service Configuration ๐ง
Clone the django-todo-cicd repository from GitHub.
Build and run Docker images for the Django Todo app.
docker build -t vedant/django-todo .
docker run -d -p vedant/django-todo
Push Docker images to Docker Hub.
Create deployment and service YAML files for Kubernetes configuration.
Deployment YAML (deployment.yml):
apiVersion: apps/v1 kind: Deployment metadata: name: todo-deployment labels: app: todo-app spec: replicas: 2 selector: matchLabels: app: todo-app template: metadata: labels: app: todo-app spec: containers: - name: todo-app image: vedanthavkar/django-todo ports: - containerPort: 8000
Service YAML (service.yml):
apiVersion: v1 kind: Service metadata: name: todo-service spec: type: NodePort selector: app: todo-app ports: - name: http port: 80 targetPort: 8000 nodePort: 30007
Deployment and Verification โ๏ธ
Apply the deployment and service YAML files using kubectl apply.
kubectl apply -f deployment.yml
kubectl apply -f service.yml
Verify that pods are running successfully.
Accessing the Application ๐
Access the Django Todo app via the worker node's public IP: http://<Public-ip-address>:30007/todos/
Conclusion ๐
This project showcases the efficient deployment of a Django Todo application on AWS EC2 using Kubernetes. Kubernetes empowers us with robust container orchestration, facilitating auto-scaling and auto-healing for improved application reliability and scalability.
Key Highlights ๐
Kubernetes Cluster Setup: Establishing a Kubernetes cluster on AWS EC2.
Docker Image Management: Building and pushing Docker images for the application.
Kubernetes Deployment and Service Configuration: Defining deployment and service YAML files for Kubernetes.
Verification and Validation: Ensuring correct application deployment and functionality.
Practical Application: Showcase of cloud-native technologies for efficient application hosting and management.
This project serves as a valuable resource for understanding cloud-native deployment practices and Kubernetes orchestration. It underscores the significance of modern DevOps practices in ensuring scalable and reliable application deployment.
As you journey deeper into cloud and DevOps, let these learnings propel you forward, equipping you with essential skills for deploying and managing applications in cloud-native environments. Incorporate these insights into your portfolio and continue exploring the vast landscape of cloud technologies. Happy deploying! ๐๐ป๐ #Django #AWS #Kubernetes #DevOps #CloudNative #Day88 ๐ก๐ง๐