Day87(DevOps)-Project-8

Day87(DevOps)-Project-8

ยท

2 min read

Project Description

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

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

Code Availability:https://github.com/gsbarure/node-todo-cicd.git

Git clone:https://github.com/gsbarure/node-todo-cicd.git

KUBEADM installation setup:https://github.com/gsbarure/kubeadm.git

Step1:Check if Master/Agent nodes are up!

kubectl get nodes

We are good to go!

Step2:Create image from Dockerfile

Step3:Create container from image and check status of container running on exposed port!

Step4:Push the to dockerhub.

Step5:Create deployment file

You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.

A Deployment provides declarative updates for Pods and ReplicaSets.

A Deployment named node-todo-deployment is created.indicated by the .metadata.name field.

  • The Deployment creates a ReplicaSet that creates three replicated Pods, indicated by the .spec.replicas field.

  • The Pod template's specification, or .template.spec field, indicates that the Pods run one container, node-todo, which runs the gajananbarure/gajanan-node-todo-appDocker Hub image at version latest

Once done with deployment.yaml creation apply it by command

kubectl apply -f deployment.yaml

check status of the pods as Replicasets=3,it should be 3 pods running

Step6:Service

ServiceIn Kubernetes, a Service is a method for exposing a network application that is running as one or more Pods in your cluster.

You use a Service to make that set of Pods available on the network so that clients can interact with it.

Here,created NodePort service.

If you set the type field to NodePort, the Kubernetes control plane allocates a port from a range specified by --service-node-port-range flag (default: 30000-32767). Each node proxies that port (the same port number on every Node) into your Service. Your Service reports the allocated port in its .spec.ports[*].nodePort field.

Apply service with kubectl apply -f service.yml and verify status of service with

kubectl get svc

Step7:Access IP and Verify if application is working as expected.

Here we go!

Code availability(GitHub):https://github.com/gsbarure/node-todo-cicd.git

Linkdin:https://www.linkedin.com/in/gajanan-barure-7351a4140

***Happy Learning :)***โœŒโœŒ

Keep learning,Keep growing๐ŸŽ‡๐ŸŽ‡

Thank you for reading!! Hope you find this helpful.

#day87#90daysofdevops#devopscommunity#

Shubham Londhe

ย