0% found this document useful (0 votes)
24 views4 pages

CC Assignment 8 (324041)

Uploaded by

temp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views4 pages

CC Assignment 8 (324041)

Uploaded by

temp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Name : Sumit Mule

Roll no. : 324041


Batch : D2
PRN no. : 22111155

CC Assignment - 8

AIM: Deploy Web app using Kubernetes


THEORY : Kubernetes is an open-source platform designed for automating the
deployment, scaling, and management of containerized applications. Originally
developed by Google, it is now maintained by the Cloud Native Computing Foundation
(CNCF). Features of Kubernetes:
● Container Orchestration: Kubernetes manages containerized applications by
providing a platform for automating deployment, scaling, and operations. It
abstracts the underlying infrastructure, enabling users to deploy applications
across clusters of machines effortlessly.
● Architecture: Kubernetes follows a master-slave architecture. The cluster
consists of a master node that manages the cluster and worker nodes where
containers run. The master node controls scheduling, scaling, and managing
application workloads based on user-defined configurations.
● Containers and Pods: Kubernetes works primarily with containers, typically
using Docker for container runtime. It organizes containers into logical units
called "pods," enabling co-located containers to share resources and network
space.
● Scaling and Load Balancing: It offers automated scaling of applications by
adjusting the number of containers based on CPU utilization or other metrics.
Additionally, Kubernetes provides built-in load balancing to distribute traffic
across multiple instances of an application.

Kubernetes has gained immense popularity due to its ability to abstract away complex
infrastructure management, provide scalability, reliability, and streamline the deployment
and management of containerized applications in a consistent manner across different
environments.
To Deploy Web app using Kubernetes

Prerequisites : A sample containerized web application


Step 1: Enable Kubernetes using Docker Desktop
● From the Docker Dashboard, navigate to Settings, and select the Kubernetes
tab.
● Select the checkbox labeled Enable Kubernetes, and select Apply & Restart.
Docker Desktop automatically sets up Kubernetes for us. We'll know that
Kubernetes has been successfully enabled when we see a green light beside
'Kubernetes running' in the Settings menu.

Step 2: Describing apps using Kubernetes YAML


All containers in Kubernetes are scheduled as pods, which are groups of co-located
containers that share some resources. Furthermore, in a realistic application we almost
never create individual pods. Instead, most of our workloads are scheduled as
deployments, which are scalable groups of pods maintained automatically by
Kubernetes. Lastly, all Kubernetes objects can and should be described in manifests
called Kubernetes YAML files. These YAML files describe all the components and
configurations of our Kubernetes app, and can be used to create and destroy our app in
any Kubernetes environment.
Now, we have to develop a YAML file to run and manage our Web Application ,container
. Sample YAML file :
In this Kubernetes YAML file, there are two objects, separated by the --- :
● A Deployment, describing a scalable group of identical pods. In this case, we'll
get just one replica, or copy of our pod, and that pod (which is described under
the template: key) has just one container in it, based off of our getting-started
image from the previous assignment.
● A NodePort service, which will route traffic from port 30001 on our host to port
3000 inside the pods it routes to, allowing us to reach our Todo app from the
network.
Also, notice that while Kubernetes YAML can appear long and complicated at first, it
almost always follows the same pattern:
● The apiVersion, which indicates the Kubernetes API that parses this object
● The kind indicating what sort of object this is
● Some metadata applying things like names to our objects
● The spec specifying all the parameters and configurations of our object.
Step 3: Deploy and checking our application
1. In a terminal, navigate to where we created bb.yaml and deploy our application to
Kubernetes
● kubectl apply -f bb.yaml

2. Make sure everything worked by listing our deployments and services:


● kubectl get deployments
● kubectl get services

In addition to the default kubernetes service, we see our bb-entrypoint service,


accepting traffic on port 30001/TCP.
3. Open a browser and visit our app at localhost:30001. We should be able to see
our app as seen in previous assignment when we ran the standalone container.

Conclusion:
In conclusion, deploying a web application using Kubernetes highlights the benefits of
container orchestration, scalability, resilience, and the ecosystem of tools available for
managing modern applications. This experience underscores the significance of
automation, consistency, and robust infrastructure management practices in the realm
of containerized applications.

You might also like