Code Monkey home page Code Monkey logo

django-todo-app's Introduction

Django Todo App Deployment

This guide will help you deploy the Django Todo App using Docker and AWS EKS.

Prerequisites

You can install the following tools from EKS/tools/ path.

  • Helm3 installed
  • Docker installed
  • AWS CLI installed
  • Eksctl installed
  • Kubectl installed
  • Git installed

Steps

  1. Clone the repository:

    git clone https://github.com/LondheShubham153/django-todo-cicd.git  
    cd django-todo-cicd/
  2. Build the Docker image:

    docker build -t uj5ghare/django-todo-app .
  3. Run the Docker image:

    docker run -d -p 8000:8000 uj5ghare/django-todo-app
  4. Login to Docker: Replace <username> and <password> with your Docker credentials.

    DOCKER_USERNAME=<username>
    DOCKER_PASSWORD=<password> 
    echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
  5. Push the Docker image:

    docker push uj5ghare/django-todo-app



Creating & Configuring EKS Cluster

  1. Create an EKS cluster:

    eksctl create cluster --name cluster1 --region ap-south-1 --fargate 
  2. Update kubeconfig:

    aws eks update-kubeconfig --name cluster1 
  3. Check the nodes:

    kubectl get nodes
  4. Create a Fargate profile:

    eksctl create fargateprofile --name profile1 --cluster cluster1 --region ap-south-1 --namespace ns1
  5. Go to this repository:

    cd Django-ToDo-App/EKS/my-dir/manifests/
  6. Apply the Kubernetes configuration:

    kubectl apply -f . 
  7. Check all the resources in the namespace:

    kubectl get all -n ns1



AWS Load Balancer Controller Setup

Follow the steps below to set up the AWS Load Balancer Controller on your EKS cluster.

  1. Export your cluster name:

    export cluster_name=cluster1
  2. Get the OIDC ID:

    oidc_id=$(aws eks describe-cluster --name $cluster_name --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 5)
  3. Associate the IAM OIDC provider:

    eksctl utils associate-iam-oidc-provider --cluster $cluster_name --approve
  4. Create the IAM policy:

    aws iam create-policy --policy-name AWSLoadBalancerControllerIAMPolicy --policy-document file://iam_policy.json
  5. Create the IAM service account:

    eksctl create iamserviceaccount --cluster=cluster1 --namespace=kube-system --name=aws-load-balancer-controller --role-name AmazonEKSLoadBalancerControllerRole --attach-policy-arn=arn:aws:iam::<your-aws-account-id>:policy/AWSLoadBalancerControllerIAMPolicy --approve
  6. Add the EKS helm repo:

    helm repo add eks https://aws.github.io/eks-charts
  7. Install the AWS Load Balancer Controller:

    helm install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName=cluster1 --set serviceAccount.create=false --set serviceAccount.name=aws-load-balancer-controller --set region=ap-south-1 --set vpcId=<your-vpc-id>
  8. Verify the deployment:

    kubectl get deployment -n kube-system aws-load-balancer-controller

django-todo-app's People

Contributors

uj5ghare avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.