cloud report
cloud report
Submitted by
MOHHAMED ISLAAM K A
(953622205028)
BACHELOR OF TECHNOLOGY
RAJAPALAYAM-626 117
APRIL 2025
i
ANNA UNIVERSITY,CHENNAI
BONAFIED CERTIFICATE
SIGNATURE SIGNATURE
Mrs. A. Alagulakshmi Dr. V. Anusuya
SUPERVISOR HEAD OF THE DEPARTMENT
Assistant Professor, Associate Professor,
Department of Information Technology, Department of Information Technology,
Ramco Institute of Technology Ramco Institute of Technology
Rajapalayam-626 112. Rajapalayam-626 112.
ii
DECLARATION
Place : Rajapalayam.
Mohamed Islaam K A
Date :/ /2025.
RAJAPALAYM-626 117.
iii
ACKNOWLEDGEMENT
First and foremost, I express my utmost gratitude to our Chairman, Shri. P.R.
Venketrama Raja, B.E., MBA., for his remarkable support and encouragement toward the
improvement of the college.
I extend my sincere thanks to our respected Principal In-charge, Dr. L. Ganesan, M.E.,
P.hD., for the support rendered toward my project work.
I am deeply grateful to our Vice Principal, Dr. S. Rajakarunakaran, M.E., Ph.D., for
his valuable support in the successful completion of my project.
I am also indebted to Dr. V. Anusuya, M.E., Ph.D., Associate Professor and Head,
Department of Information Technology, for providing the necessary lab facilities to complete
my work.
I am very much thankful to all the staff members of the Department of Information
Technology for the various ways in which they supported me during the completion of my
project.
Last but not least, I extend my sincere thanks to my friends and family members for
their unwavering support and encouragement throughout my project journey.
iv
ABSTRACT
In the rapidly evolving landscape of software development, microservice architecture
has emerged as a powerful paradigm for designing scalable, maintainable, and loosely
coupled systems. Unlike monolithic applications, microservices divide functionality
into independent services that communicate over lightweight APIs, enabling faster
development cycles, easier debugging, and more efficient scaling. To orchestrate and
manage such services, Kubernetes has become the de facto standard platform due to its
robust features for automating deployment, scaling, and management of containerized
applications.
v
TABLE OF CONTENTS
vi
1.INTRODUCTION
In today’s fast-paced software industry, the demand for scalable, modular, and resilient
applications has driven the shift from monolithic architectures to microservice-based
systems. A microservice architecture decomposes an application into a collection of
loosely coupled services, each responsible for a specific business function. This
approach enables development teams to build, test, deploy, and scale services
independently, leading to improved agility and fault isolation.
1.1PROJECT DESCRIPTION:
1
Lack of flexibility for continuous deployment and integration
Kubernetes has become the industry standard for container orchestration. It was
originally developed by Google based on its internal system Borg and later open-
sourced. As per CNCF reports, Kubernetes adoption has increased dramatically across
organizations of all sizes due to its community support, portability, and extensibility.
Literature also suggests that combining Docker and Kubernetes provides an efficient
and portable solution for deploying microservices in both development and production
environments.
2
2. SYSTEM REQUIREMENTS
➢ Storage – At least 20 GB of free disk space is required for images, containers, logs,
and Kubernetes configurations.
➢ kubectl – The command-line tool for interacting with the Kubernetes cluster, used
for applying deployments, checking pod statuses, and managing services.
➢ Node.js & npm – Required for developing and running the backend microservice.
Version 16.x or above is recommended.
➢ Text Editor or IDE – VS Code or any code editor to write and manage code
effectively.
3
➢ Browser – Google Chrome or Firefox for testing service accessibility via browser
endpoints.
➢ Docker Hub Account – Needed to push container images and access them from the
Kubernetes cluster during pod creation.
Functional Requirements:
The system shall build and run a microservice using Node.js that responds to
HTTP requests.
The system shall containerize the microservice using Docker and publish the
image to Docker Hub.
The system shall deploy the microservice container using Kubernetes
Deployment and expose it using a Service.
The system shall be accessible externally via Minikube IP and exposed
NodePort.
Non-Functional Requirements:
User Requirements:
4
3. SYSTEM DESIGN
3.1 PROPOSED SYSTEM - MODULES OF SYSTEM
The proposed system utilizes containerization and orchestration principles to deploy a
microservice-based backend using Kubernetes. The system is modular, with each
component fulfilling a specific responsibility in the overall deployment lifecycle.
1. Node.js Microservice Module
This module serves as the core backend logic. A simple Express.js application
is developed to listen on a specific port and respond to HTTP requests. It contains the
business logic and acts as a sample REST API.
2. Docker Containerization Module
This module is responsible for packaging the Node.js application into a Docker
container. A Dockerfile defines the container environment, copies the source code,
installs dependencies, and specifies the command to start the server.
3. Docker Hub Integration Module
Once the container is built, this module involves tagging and pushing the image
to Docker Hub. This allows Kubernetes to later pull the image from a centralized
registry during deployment.
4. Kubernetes Deployment Module
This module defines a Deployment YAML configuration. It specifies the
Docker image to use, the number of replicas, container ports, and restart policies.
Kubernetes ensures the desired number of containers are always running.
5. Kubernetes Service Module
This module defines a Service YAML file to expose the deployed application
to external clients. A NodePort service type is used to allow access via
<minikube-ip>:<node-port>.
6. Minikube Cluster Environment
Minikube acts as a lightweight, local Kubernetes cluster that allows testing the
system in an isolated environment. It simulates a production-like cluster, ideal for
development and educational purposes.
These modules work together to demonstrate a typical containerized microservice
architecture running in a Kubernetes environment. Each component is loosely coupled
and can be independently scaled or replaced.compliance.
5
4. Implementation/Methodology
IMPLEMENTATION
The implementation of this system revolves around containerizing a simple
Node.js microservice and deploying it within a Kubernetes cluster. Below is an
explanation of each step involved in the process, from setting up the environment to
deploying the application.
index.js:
const http = require('http');
const url = require('url');
const port = 3000;
// Home Route
if (reqUrl.pathname === '/' && req.method === 'GET') {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Welcome to the Kubernetes Microservice!');
}
// About Route
else if (reqUrl.pathname === '/about' && req.method === 'GET') {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('This is a simple microservice running on Kubernetes!');
}
// JSON Response Route
else if (reqUrl.pathname === '/api' && req.method === 'GET') {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ message: 'Hello from the API!', status: 'success' }));
}
// 404 Route
else {
res.writeHead(404, { 'Content-Type': 'text/plain' });
res.end('Page not found');
}
});
server.listen(port, () => {
console.log(`Server running on http://localhost:${port}`);
});
6
DockerFile:
FROM node:18
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: microservice-app
spec:
replicas: 1
selector:
matchLabels:
app: microservice-app
template:
metadata:
labels:
app: microservice-app
spec:
containers:
- name: microservice-app
image: <docker-hub-username>/microservice-app:latest
ports:
- containerPort: 3000
7
Service.yaml:
apiVersion: v1
kind: Service
metadata:
name: microservice-app-service
spec:
selector:
app: microservice-app
ports:
- protocol: TCP
port: 8080
targetPort: 3000
type: NodePort
To ensure the system functions correctly, several test cases are executed throughout
the deployment process:
8
o Expected Result: The pod should be in Running status, and the
deployment should be scaled as defined in the deployment.yaml file.
5. Stress Test:
o Test Case: Simulate a high number of requests to ensure that the
application can handle the load and that Kubernetes can scale the
deployment when needed.
o Expected Result: The application should scale without issues, and the
response time should remain stable under load.
ab -n 1000 -c 10 http://<minikube-ip>:<node-port>/
5. EXPERIMENTAL RESULTS:
9
10
11
6. CONCLUSION
The implementation of a microservice architecture using Kubernetes presents a
significant advancement in how modern applications are developed, deployed, and
maintained. Through this project, a basic Node.js application was successfully
containerized using Docker and deployed on a Kubernetes cluster using Minikube. This
not only showcased the flexibility of microservices but also the powerful orchestration
capabilities of Kubernetes in managing containers at scale.
The entire lifecycle of the microservice—from coding, building the Docker image,
pushing it to Docker Hub, to deploying and exposing it using Kubernetes—was
automated and standardized. This increases development velocity and makes the system
more robust and production-ready.
12
References:
Kelsey Hightower, Brendan Burns, and Joe Beda, “Kubernetes: Up and
Running”, O’Reilly Media, 2nd Edition, 2019.
Docker Documentation, https://docs.docker.com
Kubernetes Official Documentation, https://kubernetes.io/docs
Node.js Documentation, https://nodejs.org/en/docs
Minikube Documentation, https://minikube.sigs.k8s.io/docs
Martin Fowler, "Microservices – a definition of this new architectural term",
https://martinfowler.com/articles/microservices.html.
13