DEV Community

Cover image for END-TO-END Deployment Of Django App on AWS EKS Cluster
On-cloud7
On-cloud7

Posted on

END-TO-END Deployment Of Django App on AWS EKS Cluster

Today, we are deploying a Django app on an EKS Cluster and will Learn How to create an EKS cluster and deploy the app on it.

Step 1: Create a EC2 instance to run all the dependencies on the instance.

Step 2: Configure the AWS CLI, check the AWS version.

Step3: Install EKSCTL and Kubectl in the master machine(ie: EC2 instance).

*Step 4: Create an IAM user, give access to the user (administrator access) and create an access key to configure the AWS *

Step 5: Create a Cluster.

Step 6: Create an OIDC Provider.

_Now the Cluster is created in the EKS Services in AWS _

Step 7: Update Kubectl Context: so that local and remote are connected.

Step 8: Create a Folder and clone the app in the folder.

mkdir K8-practice
git clone app url
Enter fullscreen mode Exit fullscreen mode

Step 9: Create a YAML file for the namespace in Kubernetes folder.


kubectl apply -f namespace.yml
kubectl get namespaces
Enter fullscreen mode Exit fullscreen mode

Step 10: Create a yaml file for Pod in kubernetes folder.


kubectl apply -f pod.yml
kubectl get pods -n nginx
Enter fullscreen mode Exit fullscreen mode

Step 11: Create a yaml for Deployment in kubernetes folder.


kubectl apply -f deployment.yml
kubectl get deployments -n nginx
Enter fullscreen mode Exit fullscreen mode

Step 12: Create a Service yaml in kubernetes folder.


kubectl apply -f service.yml
kubectl get svc 
kubectl port-forward service/my-service 8000:8000 --address=0.0.0.0
Enter fullscreen mode Exit fullscreen mode

Reference:

Conclusion:
Overall, deploying Django on Amazon EKS helped me understand the complete workflow—from Dockerizing the application, pushing images to ECR, configuring Kubernetes manifests, and finally exposing the service through a load balancer. This approach not only improves performance and availability but also lays the foundation for implementing CI/CD and future scaling.

Top comments (0)