DevOps(Day-87): Project-8

DevOps(Day-87): Project-8

Project Description

The project involves deploying a Django Todo app on AWS EC2 using the Kubeadm Kubernetes cluster.

Kubernetes Cluster helps in the Auto-scaling and Auto-healing of your application.

Pre-requisites

  1. Create two servers with t2.medium configuration. One is referred to as master server and another is a node server.

  2. Install Docker on the server.

Project Steps

  • Get a Django Full Stack application from GitHub.

  • Setup the Kubernetes cluster using this script

    ```markdown ---------------------------------------- Kubeadm Installation ------------------------------------------

    -------------------------------------- Both Master & Worker Node --------------------------------------- sudo su apt update -y apt install docker.io -y

    systemctl start docker systemctl enable docker

    curl -fsSL "packages.cloud.google.com/apt/doc/apt-key.gpg" | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/kubernetes-archive-keyring.gpg echo 'deb packages.cloud.google.com/apt kubernetes-xenial main' > /etc/apt/sources.list.d/kubernetes.list

    apt update -y apt install kubeadm=1.20.0-00 kubectl=1.20.0-00 kubelet=1.20.0-00 -y

    ##To connect with cluster execute below commands on master node and worker node respectively --------------------------------------------- Master Node -------------------------------------------------- sudo su kubeadm init

    mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config

    kubectl apply -f github.com/weaveworks/weave/releases/downlo..

    kubeadm token create --print-join-command

------------------------------------------- Worker Node ------------------------------------------------ sudo su kubeadm reset pre-flight checks -----> Paste the Join command on worker node and append --v=5 at end

#To verify cluster connection
---------------------------------------on Master Node-----------------------------------------

kubectl get nodes ```

  • Setup Deployment and Service for Kubernetes.

  • Run the Project

Thanks for reading my article. Have a nice day.

You can follow me on LinkedIn for my daily updates:- linkedin.com/in/bandan-kumar-sahoo-131412203