0% found this document useful (0 votes)
55 views

Kubernetes cluster

deploy Super Mario on Kubernetes cluster

Uploaded by

robin rawat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Kubernetes cluster

deploy Super Mario on Kubernetes cluster

Uploaded by

robin rawat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

A REPORT OF SIX-MONTH TRAINING

at

APPSQUADZ

SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE

AWARD OF THE DEGREE OF

BACHELOR OF TECHNOLOGY

(Computer and Science Engineering)

AUG- DEC, 2024

SUBMITTED BY:

ROBIN RAWAT (2104170)

NITTIN (2104149)

NITIN (2104148)

DEPARTMENT OF COMPUTER AND SCIENCE ENGINEERING

GURU NANAK DEV ENGINEERING COLLEGE, LUDHIANA


(An Autonomous College Under UGC ACT)

CERTIFICATE BY COMPANY
STUDENT'S DECLARATION

I “ROBIN RAWAT” hereby declare that I have undertaken Six-month training at

“APPSQUADZ” during a period from Aug 2024 to Dec 2024 in partial fulfillment of

requirements for the award of degree of BTech (Information Technology) at GURU NANAK

DEV ENGINEERING COLLEGE, LUDHIANA. The work which is being presented in the

training report submitted to Department of Information Technology at GURU NANAK DEV

ENGINEERING COLLEGE, LUDHIANA is an authentic record of training work.

Signature of the Student

The six-month industrial training Viva–Voce Examination of student has been held on

____________ and accepted.

Signature of Internal Examiner Signature of External Examiner


STUDENT'S DECLARATION

I “NITIN” hereby declare that I have undertaken Six-month training at “APPSQUADZ” during

a period from Aug 2024 to Dec 2024 in partial fulfillment of requirements for the award of

degree of BTech (Information Technology) at GURU NANAK DEV ENGINEERING

COLLEGE, LUDHIANA. The work which is being presented in the training report submitted

to Department of Information Technology at GURU NANAK DEV ENGINEERING

COLLEGE, LUDHIANA is an authentic record of training work.

Signature of the Student

The six-month industrial training Viva–Voce Examination of student has been held on

____________ and accepted.

Signature of Internal Examiner Signature of External Examiner


STUDENT'S DECLARATION

I “NITIN” hereby declare that I have undertaken Six-month training at “APPSQUADZ” during

a period from Aug 2024 to Dec 2024 in partial fulfillment of requirements for the award of

degree of BTech (Information Technology) at GURU NANAK DEV ENGINEERING

COLLEGE, LUDHIANA. The work which is being presented in the training report submitted

to Department of Information Technology at GURU NANAK DEV ENGINEERING

COLLEGE, LUDHIANA is an authentic record of training work.

Signature of the Student

The six-month industrial training Viva–Voce Examination of student has been held on

____________ and accepted.

Signature of Internal Examiner Signature of External Examiner


ABSTRACT

This project is designed to deploy the iconic Super Mario game on the Amazon Elastic

Kubernetes Service (EKS), utilizing the powerful capabilities of Kubernetes for orchestration

and scaling. The core objective is to delve into the deployment process of a containerized

application within a cloud-native environment, taking full advantage of AWS infrastructure to

achieve remarkable scalability, high availability, and streamlined management.

To facilitate this deployment, we will employ Terraform for robust infrastructure provisioning,

allowing for the automated setup and maintenance of cloud resources. Kubectl will be used for

efficient management of Kubernetes clusters, enabling smooth operations and monitoring.

Additionally, Docker will play a crucial role in containerization, encapsulating the Super Mario

game into lightweight, portable containers that can be easily deployed across various

environments.

This project not only demonstrates a modern methodology for deploying legacy applications

but also highlights the significant advantages of container orchestration. Key focuses include

automation of deployment processes, accelerated deployment speed, and enhanced scalability

within the cloud infrastructure. Ultimately, this initiative aims to bring the beloved Super Mario

game into the cloud era, ensuring accessible and scalable gameplay for fans and new players

alike.
ACKNOWLEDGEMENT

I am highly grateful to Dr. Sehijpal Singh, Principal, Guru Nanak Dev Engineering College

(GNDEC), Ludhiana, for providing this opportunity to carry out six months of Industrial

Training at Ocean Clouds. The constant guidance and encouragement received from Dr.

Parminder Singh, Head of the Department, GNDEC Ludhiana, has been invaluable during

the training and project work, and I acknowledge their support with heartfelt thanks.

I would like to express my deepest gratitude to Mr. Ranu Mishra, my mentor at AppSquadz,

for providing invaluable insights and support throughout the training and project work. His

expertise and guidance played a pivotal role in the successful understanding.

I’d like to thank my college, Guru Nanak Dev Engineering College for providing me with the

opportunity to work through the training. Lastly, I extend my gratitude to the faculty members

of the Information Technology Department for their continuous support and motivation

throughout this endeavor, and I am deeply grateful to everyone who has contributed to the

successful completion of this project

Robin Rawat (2104170)

Nittin (2104149)

Nitin (2104148)
LIST OF FIGURES

Figure 1.1 .......................................................................................................... 40

Figure 1.2........................................................................................................... 41

Figure 1.3 ........................................................................................................... 41

Figure 1.4 ........................................................................................................... 42

Figure 1.5 ........................................................................................................... 42

Figure 1.6 ........................................................................................................... 42

Figure 1.7 ........................................................................................................... 43

Figure 1.8 ........................................................................................................... 43

Figure 1.9 ........................................................................................................... 44

Figure 1.10 ...........................................................................................................44

Figure 1.11 ......................................................................................................... 45

Figure 1.12 .......................................................................................................... 46

Figure 2.1 .......................................................................................................... 61

Figure 2.2 ........................................................................................................... 61

Figure 2.3 ........................................................................................................... 61

Figure 2.4 ........................................................................................................... 62

Figure 2.5 ........................................................................................................... 62


Figure 2.6 ........................................................................................................... 62

Figure 2.7 ........................................................................................................... 63

Figure 2.8 ........................................................................................................... 63

Figure 2.3.3 ......................................................................................................... 71

Figure 3.1 ........................................................................................................... 72

Figure 3.2 ........................................................................................................... 72

Figure 3.3 ........................................................................................................... 73

Figure 3.4 ........................................................................................................... 73

Figure 3.5 ........................................................................................................... 74

Figure 3.6 ........................................................................................................... 74


CONTENTS

Topic Page No.

Certificate by Company/Industry/Institute i
Candidate’s Declaration ii
Abstract iii
Acknowledgement iv
About the Company/ Industry / Institute v
List of Figures vi

CHAPTER-1 INTRODUCTION ............................................................................. 39


1.1 Training Overview .................................................................................. 39
1.2 Technologies and Tools .............................................................................. 39
1.2.1 Amazon Web Services (AWS) ............................................................... 39
1.2.2 DevOps ................................................................................................... 45
1.3 Project Category ..................................................................................... 48
1.4 Objectives .................................................................................................. 49
1.5 Problem Formulation ................................................................................. 50
1.6 Learning Goals ........................................................................................... 51
CHAPTER-2 TRAINING WORK UNDERTAKEN .................................................. 53
2.1 Schedule of Training ................................................................................... 53
2.2 Introduction to Project ............................................................................... 54
2.2.1 Requirement Analysis and System Specification ......................................... 54
2.2.2 Feasibility Study ...................................................................................... 56
2.3 System Design ............................................................................................ 57
2.3.1 Design Approach ..................................................................................... 57
2.3.2 Building Process ...................................................................................... 59
2.3.3 System Architecture ................................................................................. 70
2.3.3 Flowchart ................................................................................................ 71
CHAPTER-3 RESULTS AND DISCUSSION ........................................................... 72
3.1 Snapshots of Project................................................................................ 72
3.2 Results of Project .................................................................................... 74
CHAPTER-4 CONCLUSION AND FUTURE SCOPE .............................................. 77
4.1 Conclusion ............................................................................................. 77
4.2 Future Scope .......................................................................................... 78
REFERENCES ...................................................................................................... 79
ABOUT THE COMPANY

APPSQUADZ, an advanced AWS consulting partner, is one of the leading cloud migration and

consultation service providers which is committed to helping customers and enabling them to

build a better tomorrow using the power of the cloud. Additionally, it is enabling businesses to

leverage digital transformation through its mobile & web app development services.

APPSQUADZ has a team of over 200 IT professionals who have developed 850+ web and

mobile apps globally that work seamlessly with the latest OS updates. We specialize in serving

the clients from Broadcast, Media, and entertainment Sectors with our next-gen cloud-based

services.

As a leading Mobile & Web App Development Company, our professional expertise lies in IoT,

Blockchain, web app development, AR/VR, cross-platform. Our dedication and commitment

to 100% client satisfaction is the chief reason for our global presence.

With 15+ years of experience and 850+ Apps developed; we are here to deliver high-end

advanced services to our clients. Our mixed team of developers, testers, marketers, and

designers are consistent in the pursuit of meaningful goals of customer satisfaction and

punctuality in the delivery of projects.

38
CHAPTER-1 INTRODUCTION

1.1 Training Overview

In this training starting with the basics of networking and progressing to more advanced cloud
and DevOps tools. Developed a solid understanding of key concepts, followed by hands-on
experience with the most widely-used technologies in cloud computing and DevOps.

We begin by laying a foundation in networking. Understanding how networks function is


essential, as it forms the backbone of cloud computing. We started with fundamental topics like
the OSI model, IP addressing, subnetting, and routing. These concepts are crucial for anyone
working in the cloud, as networking plays a key role in ensuring that systems can communicate
efficiently. By the end of this phase, we had the good grasp of networking basics and be
prepared to dive into the cloud.

Next, we move to cloud computing, focusing specifically on AWS, one of the most popular
cloud platforms. We have learnt about the different cloud service models (IaaS, PaaS, and SaaS)
and AWS services such as EC2, S3, IAM, VPC, and CloudFormation. These services will help
us deploy and manage applications in the cloud securely and efficiently. This phase equips us
with the foundational skills needed to work with cloud technologies.

After establishing a solid cloud foundation, we shift to DevOps tools, which focus on
automating the software development lifecycle. This training helped us to equip into practical
skills in networking, AWS, and DevOps tools.

1.2 Technologies and Tools

1.2.1 Amazon Web Services (AWS)

Amazon Web Services (AWS) is a leading cloud computing platform that provides an extensive
array of cloud services designed to meet diverse computing needs. In this project, AWS played
a pivotal role in supplying the necessary cloud resources, which included compute instances,
container orchestration capabilities, and scalable storage solutions. It is a prominent subsidiary
39
of Amazon, specializing in the delivery of on-demand cloud computing platforms and
Application Programming Interfaces (APIs) tailored for a diverse clientele that includes
individuals, businesses, and governmental entities. These services operate on a flexible,
metered model that follows a pay-as-you-go pricing structure, allowing customers to only pay
for the resources they use.

One of the key features of AWS is its autoscaling capability, which enables clients to
automatically adjust their computing resources in response to fluctuations in application usage.
During periods of high demand, users can efficiently scale up their resources to meet the
increased load and similarly scale down when traffic decreases, helping to manage costs
effectively.

At the core of AWS's service offerings is the Amazon Elastic Compute Cloud (EC2). This
foundational service empowers users by providing access to a virtual cluster of computing
resources that boasts exceptional availability. Users can interact with these virtual machines
seamlessly over the internet through various methods, including REST APIs, a Command Line
Interface (CLI), or the intuitive AWS Management Console.

Figure 1.1 AWS Cloud Platform

40
Some of the services by AWS used in our project are:

1 Elastic Kubernetes Service (EKS): EKS, or Elastic Kubernetes Service, is a fully


managed service that simplifies the process of deploying, managing, and scaling
containerized applications using Kubernetes. Throughout this project, EKS was
instrumental in orchestrating the Super Mario game container, ensuring it operated
efficiently. The service facilitated automated scaling and robust management, allowing the
game to remain responsive under varying loads.

Figure 1.2 Elastic Kubernetes Service (EKS)

2 Elastic Compute Cloud (EC2): EC2, or Elastic Compute Cloud, offers scalable virtual
servers in the cloud, providing the flexibility to scale computing resources as needed. For
this project, EC2 instances were utilized to host the backend infrastructure of the game, as
well as the critical tools required to deploy and manage the Kubernetes cluster efficiently.

Figure 1.3 Elastic Compute Cloud (EC2)

3 Identity and Access Management (IAM): IAM, or Identity and Access Management, is
a vital service used to regulate user access and permissions across AWS services. In the
context of this project, an IAM role was specifically created with the appropriate
permissions, enabling safe and controlled interactions with important AWS resources,
including EC2, EKS, and S3.

41
Figure 1.4 Identity and Access Management (IAM)

4 IAM Role for EC2: To enhance security and management, the EC2 instance was assigned
a dedicated IAM role. This role allowed the instance to seamlessly access other AWS
services, facilitating effective management of resources such as EKS clusters without
compromising the principles of least privilege.

Figure 1.5 IAM Role for EC2

5 Simple Storage Service (S3): Amazon S3, or Simple Storage Service, is a highly scalable
storage solution that provides durable and secure storage for static files. In this project, S3
was utilized to store essential artifacts, including Terraform state files and other
deployment configurations. This ensured that all data was maintained in a reliable
environment, ready for use during deployment and updates.

Figure 1.6 Simple Storage Service (S3)

42
6 CloudWatch: AWS CloudWatch serves as a comprehensive monitoring and logging tool
that tracks the activity of AWS resources. In this project, CloudWatch was crucial for
overseeing the performance and operational status of EKS clusters, EC2 instances, and
other AWS services. It enabled prompt troubleshooting and performance analysis during
the deployment process, ensuring that issues could be swiftly identified and resolved.

Figure 1.7 CloudWatch

7 Elastic Load Balancer (ELB): Elastic Load Balancing automatically distributes your
incoming traffic across multiple targets, such as EC2 instances, containers, and IP
addresses, in one or more Availability Zones. It can automatically scale to the vast majority
of workloads. Elastic Load Balancing supports the following load balancers: Application
Load Balancers, Network Load Balancers, Gateway Load Balancers, and Classic Load
Balancers.

Figure 1.8 Elastic Load Balancer (ELB)

8 Autoscaling: Autoscaling, often referred to as auto scaling or automatic scaling, is a


sophisticated method utilized in cloud computing that enables dynamic adjustment of
computational resources within a server farm. This resource adjustment is typically gauged
by the number of active servers and is performed automatically in response to the varying
loads on the system. For instance, in the context of a web application, autoscaling allows
for the seamless increase or decrease of server instances based on real-time metrics, such
as the number of concurrent users accessing the site. This ensures optimal performance and

43
resource efficiency, allowing applications to effectively handle traffic spikes or dips
without manual intervention.

Figure 1.8 Autoscaling

9 Amazon Virtual Private Cloud (VPC): VPC is a cloud computing service that allows
businesses to create a virtual private cloud within Amazon Web Services (AWS). VPC
provides a secure, logically isolated section of AWS where enterprises can access the
Amazon Elastic Compute Cloud (EC2) through an IPsec-based virtual private network.
Unlike traditional EC2 instances, which receive automatically assigned IP addresses, VPC
allows customers to choose their own IP addresses from various subnets, offering more
flexibility and control over their networking environment.

Figure 1.10 VPC

10 AWS Billing and Management: It is a crucial component of using Amazon Web Services
(AWS), as it helps users manage the costs associated with using cloud resources.
Understanding how AWS billing works and utilizing its management tools is essential to
avoid unexpected charges and to optimize your cloud spending. AWS follows a pay-as-
you-go pricing model, which means you are charged only for the resources you actually
use. This is one of the key benefits of cloud computing because you can scale your

44
resources up or down based on your needs, and you don’t have to worry about paying for
idle infrastructure.

Figure 1.11 AWS Billing and Management

1.2.2 DevOps

DevOps represents a transformative approach that integrates cultural philosophies, practices,

and technology tools, aimed at enhancing an organization’s capability to deliver applications

and services with remarkable speed and efficiency. This methodology fosters a collaborative

environment where development (Dev) and operations (Ops) teams work together seamlessly,

enabling them to iterate on products and services more rapidly than organizations that rely on

conventional software development and infrastructure management techniques. The accelerated

pace of delivery not only allows for continuous improvement and innovation but also empowers

organizations to respond swiftly to customer needs and market changes, thereby enhancing their

competitive edge in today's fast-paced digital landscape. These teams use practices to automate

processes that historically have been manual and slow. They use a technology stack and tooling

which help them operate and evolve applications quickly and reliably. These tools also help

engineers independently accomplish tasks (for example, deploying code or provisioning

infrastructure) that normally would have required help from other teams, and this further

increases a A team’s velocity.

45
Figure 1.12 DevOps

Some of the tools of DevOps are:

1 Git: Git is a DevOps tool used for source code management. It is a free and open-source
version control system used to handle small to very large projects efficiently. Git is used
to tracking changes in the source code, enabling multiple developers to work together on
non-linear development. Linus Torvalds created Git in 2005 for the development of the
Linux kernel.

2 Maven: Maven is a powerful project management tool that is based on POM (project
object model). It is used for project build, dependency, and documentation. It simplifies
the build process like ANT. But it is too much more advanced than ANT. In short terms
we can tell maven is a tool that can be used for building and managing any Java-based
project. maven makes the day-to-day work of Java developers easier and generally helps
with the comprehension of any Java-based project.

46
3 Jenkins: Jenkins is an open-source continuous integration (CI) server. It manages and
controls several stages of the software delivery process, including build, documentation,
automated testing, packaging, and static code analysis. Jenkins is a highly popular DevOps
tool used by thousands of development teams. Jenkins automation is commonly triggered
by code changes in repositories like GitHub, Bitbucket, and GitLab, and integrates with
build tools like Maven and Gradle. Jenkins supports the use of container technologies like
Docker and Kubernetes for testing and packaging of software releases, but it is neither a
Kubernetes native solution nor a container-native CI solution.

4 Docker: Docker is a set of Platforms as a service (PaaS) product that use Operating system-
level virtualization to deliver software in packages called containers. Containers are
isolated from one another and bundle their own software, libraries, and configuration files;
they can communicate with each other through well-defined channels. All containers are
run by a single operating system kernel and therefore use fewer resources than a virtual
machine. Docker is an open-source containerization platform by which you can pack your
application and all its dependencies into a standardized unit called a container. Containers
are light in weight which makes them portable and they are isolated from the underlying
infrastructure and from each other container. You can run the docker image as a docker
container in any machine where docker is installed without depending on the operating
system.

5 Kubernetes: Kubernetes is an open-source Container Management tool that automates


container deployment, container scaling, descaling, and container load balancing (also
called a container orchestration tool). It is written in Golang and has a vast community
because it was first developed by Google and later donated to CNCF (Cloud Native
Computing Foundation). Kubernetes can group ‘n’ number of containers into one logical
47
unit for managing and deploying them easily. It works brilliantly with all cloud vendors
i.e. public, hybrid, and on-premises. It provides healing by automatically restarting failed
containers and rescheduling them when their hosts die. This capability improves the
application’s availability.

6 Nagios: Nagios is a free and open-source software application for computer systems. It is
used for monitoring the systems, networks and infrastructure. This software application
mainly provides the services of monitoring and alerting for switches, applications, and
servers inside the DevOps culture. It is also used to notify the users when the things go bad,
and also alerts them when the things become better. This software application is written in
C language, which was mainly designed to run under the Linux operating systems. But it
can also run under Unix and Windows operating system.

1.3 Project Category

This project falls under the Cloud Computing and Containerized Application Deployment
categories, as it focuses on deploying and managing an application (Super Mario game)
using cloud infrastructure and containerization technologies. More specifically, it
combines the following categories:

1. Cloud Computing
The project utilizes AWS (Amazon Web Services) to provision, manage, and scale cloud-
based resources like EC2 instances, EKS clusters, and S3 storage. AWS provides the

48
infrastructure needed to deploy the Super Mario game in a cloud-native environment,
ensuring high availability and scalability.

2. DevOps / Infrastructure Automation


The use of Terraform for Infrastructure as Code (IaC) automates the provisioning and
management of AWS resources. The project follows DevOps principles by integrating
continuous deployment and infrastructure management, enabling automated and efficient
deployment of the Super Mario game on Kubernetes.

3. Containerization and Orchestration


The project heavily relies on Docker and Kubernetes. Docker is used to containerize the
Super Mario game, making it portable and consistent across different environments.
Kubernetes, deployed on AWS using EKS, orchestrates and manages the containers,
ensuring the game scales automatically and performs efficiently.

5. Microservices Architecture
The project also follows the principles of Microservices Architecture, where the Super
Mario game is treated as a containerized service. Kubernetes ensures that this service can
be scaled, updated, and managed independently of other services in the cloud.

1.4 Objectives
The objectives of the *Super Mario Game Deployment on AWS EKS* project are:

1. Deploy Super Mario on AWS: Use AWS services like EC2, EKS, and S3 to deploy and
host the game in a scalable cloud environment.

2. Automate Infrastructure with Terraform: Leverage Terraform to automate the creation


of AWS resources and infrastructure.

3. Containerize the Game: Use Docker to containerize Super Mario for consistency and
portability across environments.

49
4. Orchestrate with Kubernetes: Deploy the containerized game on AWS EKS to ensure
scalability, high availability, and load balancing.

5. Implement Security: Set up IAM roles, VPC, and security groups to secure the game
environment.

6. Integrate Load Balancer: Use an AWS Load Balancer to ensure smooth access to the game
for users.

7. Optimize Costs: Monitor resources and scale efficiently to minimize operational costs.

1.5 Problem Formulation

In today's rapidly evolving technology landscape, businesses and developers are continuously
looking for ways to deploy and scale applications efficiently while minimizing costs. The
challenge lies in leveraging cloud technologies to provide a seamless user experience,
particularly in the context of deploying a game like Super Mario on a cloud infrastructure.

The specific problems this project aims to address include:

1. Scalability Issues: Traditional game hosting solutions may struggle to handle sudden spikes
in traffic, especially for multiplayer or globally accessible games. There is a need to scale the
infrastructure dynamically based on demand.

2. Infrastructure Management Complexity: Managing the underlying infrastructure and


ensuring it is optimized for performance, availability, and security can be overwhelming. There
is a need for a streamlined solution that simplifies the deployment process while ensuring
reliability.

3. High Operational Costs: Traditional hosting methods can incur high operational costs,
especially when resources are underutilized. Efficient resource management and cost
optimization are crucial to minimize cloud expenses.

50
4. Manual Deployment Challenges: Manually deploying and updating the game environment
can lead to errors, delays, and inconsistencies. There is a need for automated deployment and
management processes to ensure smooth operations.

5. Security Concerns: Ensuring the security of the game environment, including user data and
game assets, is critical. Improper configurations can lead to vulnerabilities and potential
breaches.

By addressing these challenges, this project aims to create an efficient, secure, and scalable
solution for deploying and managing the Super Mario game on AWS using containerization,
Kubernetes, and cloud infrastructure automation.

1.6 Learning Goals

The primary learning goals of this project are:

1. Understanding Cloud Infrastructure Management:

• Gain hands-on experience in managing cloud infrastructure on AWS, with a focus on


services like EC2, EKS, IAM, and S3.
• Learn how to configure and manage cloud resources, ensuring that they are optimized for
scalability, security, and cost-efficiency.

2. Mastering Kubernetes for Orchestration:

• Deepen understanding of Kubernetes for container orchestration and learn how to


deploy and manage applications in a Kubernetes environment, such as Super Mario.
• Learn about Kubernetes clusters, deployments, services, and load balancing to ensure
high availability and resilience.

3. Improving Security Practices:

• Gain knowledge in setting up secure cloud environments using IAM roles, security
groups, and policies to protect resources and data.
• Understand how to securely manage sensitive information like access keys, credentials,
and data in transit.

51
4. Optimizing Cost and Resources:

• Learn how to analyze and optimize resource utilization on the cloud to reduce
operational costs while ensuring optimal performance.
• Understand the concept of autoscaling in cloud services, which helps scale resources
based on demand.

5. Deepening Knowledge of DevOps Practices:

• Gain practical experience in applying DevOps practices such as version control,


infrastructure as code (IaC), and continuous integration/continuous deployment
(CI/CD).
• Learn to troubleshoot and manage applications using Kubernetes, enhancing
reliability and reducing downtime.

6. Building Real-World Applications:

• Build and deploy a real-world application (Super Mario game) on the cloud using
modern cloud technologies and containerization.
• Gain experience in troubleshooting and maintaining live environments and games
hosted on cloud infrastructure.

52
CHAPTER-2 TRAINING WORK UNDERTAKEN

2.1 Schedule of Training

Networking Fundamentals and Basics of AWS:

This phase covers the foundation of networking, including the OSI model, IP addressing,
routing, and essential protocols like TCP/IP. Alongside, you’ll get introduced to AWS cloud
computing, exploring the AWS Management Console, core services like EC2 (virtual servers),
S3 (storage), IAM (security), and basic VPC networking. This combination helps build a strong
base for understanding cloud and network integration.

Core AWS Services and Introduction to DevOps Tools:

Dive deeper into AWS services such as Elastic Load Balancing, Auto Scaling, and
CloudFormation for managing infrastructure. Transition into DevOps with Git for version
control, learning workflows like branching, merging, and collaborating using GitHub or GitLab.
Additionally, Maven is introduced for automating Java project builds and dependency
management.

CI/CD with Jenkins and Containerization with Docker

Learn Continuous Integration and Deployment (CI/CD) with Jenkins, setting up pipelines for
automated builds and deployments. The focus then shifts to Docker, where you’ll explore
creating and managing containers, writing Docker files, and orchestrating multi-container
applications using Docker Compose. This section emphasizes automating workflows and
containerized environments.

Kubernetes and DevOps Practices

Discover Kubernetes, mastering core concepts like Pods, Deployments, Services, and scaling
applications. Learn to manage ConfigMaps, Secrets, and persistent storage for stateful
applications. This phase also introduces advanced tools like Helm for Kubernetes application
deployment, Prometheus for monitoring, and Fluentd for centralized logging, ensuring a
complete DevOps workflow understanding.

53
2.2 Introduction to Project
The "Super Mario Deployment on AWS EKS" project is a practical implementation of modern
cloud and containerization technologies to bring the nostalgic Super Mario game into a scalable,
reliable, and cloud-native environment. This project explores the potential of deploying a
classic gaming application using Amazon Elastic Kubernetes Service (EKS), a robust managed
Kubernetes platform provided by AWS. By leveraging Kubernetes orchestration, this project
demonstrates efficient containerized application management with features such as scalability,
load balancing, and high availability. The primary focus is to utilize AWS cloud services and
DevOps tools to ensure a seamless deployment and user experience. Key components include
creating an EKS cluster using Terraform for infrastructure automation, Docker for
containerizing the Super Mario game application, and Kubernetes manifests for defining
deployment and service configurations. Essential AWS services like IAM roles ensure secure
resource management, while the S3 bucket can serve as a storage solution for logs or backups.
This project not only highlights the technological advancements in cloud computing and
container orchestration but also provides hands-on experience with real-world deployment
scenarios. The end result is a fully operational and scalable Super Mario game accessible
through a web interface, encapsulating the blend of nostalgia with cutting-edge technology.

2.2.1 Requirement Analysis and System Specification

For the successful implementation of the Super Mario game on AWS Elastic Kubernetes
Service (EKS), it is crucial to conduct an in-depth analysis of both functional and non-
functional requirements, as well as to outline specific system specifications. The following
provides a comprehensive overview:

I. Functional Requirements:

1. Deployment Environment: Create a scalable and highly available Kubernetes cluster


utilizing AWS EKS to effectively host the Super Mario game. This environment should
be capable of dynamically adjusting resources to accommodate varying player loads.

54
2. Application Deployment: Employ Kubernetes deployment manifests to meticulously
configure various components such as pods, replicas, and services. This will ensure that
the application is robustly deployed and can efficiently manage game instances.

3. User Accessibility: Create a user-friendly public endpoint through a Load Balancer,


allowing players to access the Super Mario game seamlessly via their web browsers,
thereby enhancing the overall gaming experience.

II. Non-Functional Requirements:

1. Performance: Guarantee low latency and rapid response times to deliver an optimal
gaming experience. This includes optimizing the application and infrastructure to
minimize delays and ensure smooth gameplay.
2. Reliability: Design the system with high availability and failover capabilities to mitigate
the risk of downtime. This will ensure that players can enjoy uninterrupted gameplay,
even in the event of unexpected failures.
3. Security: Implement robust security measures by leveraging IAM roles, access policies,
and encrypted communication protocols. This will safeguard cloud resources and protect
sensitive player data from potential threats.

III. System Specification:


• Cloud Platform: Amazon Web Services (AWS)
• Operating System: Ubuntu Server 22.04 LTS
• Kubernetes Distribution: Amazon EKS
• Required Tools:
• Terraform for Infrastructure as Code (IaC) to define and provision the infrastructure
efficiently
• Docker for containerization, ensuring that the game and its dependencies are packaged
together
• Kubectl for managing Kubernetes resources and facilitating deployment workflows
55
IV. Services and Resources:
• Utilize IAM roles to manage resource access securely and effectively.
• Implement Amazon S3 for storing application backups, logs, and other critical data.
• Provision the EC2 instances necessary to support the cluster nodes.

2.2.2 Feasibility Study

Conducting a feasibility study is essential to determine the practicality, achievability, and value
of the project. This assessment spans technical, operational, and economic dimensions:

I. Technical Feasibility:
o Technology Stack: The project employs a solid foundation of widely-used
technologies, including AWS, Kubernetes, and Terraform. This ensures access
to extensive community support and resources for troubleshooting and
enhancement.

o *Infrastructure Availability: AWS provides a comprehensive suite of services,


such as EC2, EKS, and IAM, which simplifies the deployment process and
allows for a seamless integration of resources.

o *Skill Set: It is important that team members possess or develop the necessary
expertise in cloud infrastructure, Kubernetes, and automation tools through
training and practical experience.
II. Operational Feasibility:
o The project aligns well with established DevOps practices, facilitating efficient
deployment, scaling, and maintenance of the application.

o Kubernetes ensures effective management of resources, allowing the application


to maintain high availability and respond proactively to user demands.

56
III. Economic Feasibility:
o AWS’s pay-as-you-go pricing model supports cost-effective resource allocation,
enabling the project to only incur expenses for those resources actively in use.

o The scalability of the project means that resources can be adjusted based on
traffic requirements, preventing excess costs during periods of low user activity.

2.3 System Design

System design refers to the structured process of defining the architecture, components,
modules, interfaces, and data flow for a project to achieve specific objectives. In the context of
this project, the design focuses on deploying a containerized Super Mario game on AWS EKS.
It involves planning the infrastructure using Terraform, configuring the EKS cluster for
scalability, and deploying the application with Kubernetes manifests. Key components include
Docker for containerization, Kubernetes for orchestration, and AWS services like IAM for
security and S3 for storage. This design ensures scalability, reliability, and an optimized user
experience in a cloud-native environment.

2.3.1 Design Approach

The design approach for this project is centered on achieving a highly efficient, scalable, and
resilient deployment of the Super Mario game on the AWS Elastic Kubernetes Service (EKS).
This methodology leverages cutting-edge cloud computing practices, effective container
orchestration, and robust infrastructure provisioning techniques to deliver an exceptionally
smooth gaming experience. Below are the detailed steps involved in this approach:

1. Infrastructure as Code (IaC)

We utilize Terraform as a key tool to automate the creation and management of essential cloud
resources, which include Virtual Private Clouds (VPCs), various subnets, and EKS clusters. By
defining the infrastructure using a declarative syntax, we ensure that deployment is not only

57
consistent and repeatable but also allows for easy updates or rollbacks when necessary. This
practice minimizes human error and provides a clear pathway to manage infrastructure changes
over time.

2. Containerization with Docker

The Super Mario game itself is encapsulated within a Docker container. This process involves
packaging the game application along with all its required dependencies into a single unit.
Containerization enhances the application's portability across diverse environments, ensuring
that the game performs consistently whether it's deployed locally for testing or in a production
environment on the cloud.

3. Cluster via Kubernetes

We employ Kubernetes to effectively manage and orchestrate the Docker containers on the
AWS EKS platform. Kubernetes plays a crucial role in ensuring that the game remains highly
available to users by automatically scaling the application based on demand and implementing
self-healing mechanisms. For instance, if any container fails, Kubernetes can automatically
restart it, thereby enhancing the overall reliability of the deployment.

4. AWS Service Integration


• IAM (Identity and Access Management): We set up secure access controls for instances
and services, ensuring that authentication and permissions are appropriately managed.
This is critical for safeguarding sensitive resources and limiting access to authorized
users only.
• S3 (Simple Storage Service): Amazon S3 is utilized for the storage of essential
configuration files or backup data that supports the game application. This service
provides durability and flexibility in data management.
• EC2 (Elastic Compute Cloud): EC2 machines serve as the provisioning agents for our
Terraform scripts and act as the primary entry points for managing the Kubernetes
clusters.
5. Networking and Load Balancing

To facilitate user access to the Super Mario application, we configure Kubernetes Services to
expose the game effectively. By utilizing a Load Balancer service type, we can automatically

58
provision an external load balancer. This setup not only simplifies access to the game through
a web browser but also provides users with an intuitive ingress URL that enhances their overall
experience.

6. Monitoring and Debugging

For monitoring the deployments and ensuring the smooth operation of the application, we make
use of tools such as kubectl to check the status of pods and diagnose any potential errors.
Comprehensive logging mechanisms are integrated into the system, allowing us to quickly
identify and address issues that may arise in either application performance or infrastructure
stability.

7. Scalability and Resilience


• Through the capabilities of Kubernetes, we ensure that our system can adeptly manage
varying loads by automatically adjusting the number of pods in response to user demand.
Additionally, Kubernetes enhances resilience by redistributing active workloads in the
event of node failures, ensuring that the game remains accessible to players regardless
of fluctuations in server demand.
• This well-rounded design approach not only elevates the user experience but also lays
a strong foundation for future enhancements and expansions of the Super Mario game
in a cloud-native environment.

2.3.2 Building Process

STEP 1: Launch Ubuntu Instance

1. Sign in to AWS Console: Log in to your AWS Management Console.

2. Navigate to EC2 Dashboard: Go to the EC2 Dashboard by selecting “Services” in the


top menu and then choosing “EC2” under the Compute section.

3. Launch Instance: Click on the “Launch Instance” button to start the instance creation
process.

59
4. Choose an Amazon Machine Image (AMI): Select an appropriate AMI for your
instance. For example, you can choose Ubuntu image.

5. Choose an Instance Type: In the “Choose Instance Type” step, select t2.micro as your
instance type. Proceed by clicking “Next: Configure Instance Details.”

6. Configure Instance Details:

• For “Number of Instances,” set it to 1 (unless you need multiple instances).


• Configure additional settings like network, subnets, IAM role, etc., if necessary.
• For “Storage,” click “Add New Volume” and set the size to 8GB (or modify the
existing storage to 8GB).
• Click “Next: Add Tags” when you’re done.

7. Add Tags (Optional): Add any desired tags to your instance. This step is optional, but

it helps in organizing instances.

8. Configure Security Group:

• Choose an existing security group or create a new one.


• Ensure the security group has the necessary inbound/outbound rules to allow
access as required.

9. Review and Launch: Review the configuration details. Ensure everything is set as

desired.

10. Select Key Pair:

1. Select “Choose an existing key pair” and choose the key pair from the dropdown.
2. Acknowledge that you have access to the selected private key file.
3. Click “Launch Instances” to create the instance.

11. Access the EC2 Instance: Once the instance is launched, you can access it using the

key pair and the instance’s public IP or DNS.

60
STEP 2: Create IAM role

Figure 2.1 Search for IAM in the search bar of AWS and click on roles

Figure 2.2 Click on Create Role

Figure 2.3 Select entity type as AWS service and use case as EC2 and then Next

61
Figure 2.4 Select Administrator Access

Figure 2.5 Provide Name for Role and then Create Role

Figure 2.6 Role is Created

Now Attach this role to Ec2 instance that we created earlier, so we can provision cluster from
that instance.

62
Go to EC2 Dashboard and select the instance.

Figure 2.7 Click on Actions -> Security -> Modify IAM Role

Figure 2.8 Update IAM Role

Connect the instance to Putty

STEP 3: Cluster provision

Now clone this Repo.

change directory

Provide the executable permission to script.sh file, and run it.

63
This script will install Terraform, AWS cli, Kubectl, Docker.

Check versions

Now change directory into the EKS-TF

Run Terraform init

64
Now run terraform validate and terraform plan

65
Now Run terraform apply to provision cluster.

Completed in 10mins

66
Update the Kubernetes configuration

Make sure change your desired region

Now change directory back to k8s-mario

Let’s apply the deployment and service

Deployment

67
Now let’s apply the service

Service

Now let’s describe the service and copy the LoadBalancer Ingress

68
Paste the ingress link in a browser and you will see the Mario game.

Let’s Go back to 1985 and play the game like children.

69
2.3.3 System Architecture

The system architecture for deploying Super Mario on AWS EKS is designed to be scalable,
resilient, and efficient. It consists of the following components:

1. Frontend (Super Mario Game):

The game is packaged as a Docker container and deployed on Kubernetes clusters.

2. AWS EKS Cluster:

The application runs within an EKS cluster, which orchestrates and manages the containers
for scalability and fault tolerance.

3. AWS EC2 Instances:

Used for running the infrastructure provisioning scripts (Terraform, AWS CLI, Kubectl).

4. IAM (Identity and Access Management):

Manages access permissions for AWS resources, ensuring secure operations.

5. S3 Storage:

Stores configuration files and backups for the game and infrastructure.

6. Kubernetes Services & Load Balancer:

Kubernetes services expose the application, and a LoadBalancer distributes traffic to ensure
availability.

This architecture integrates cloud-native technologies for a seamless and scalable deployment
of the Super Mario game.

70
2.3.3 Flowchart

Figure 2.3.3 Flowchart

This outlines the process of deploying the classic Super Mario game on Amazon EKS using
Terraform. It includes steps like setting up an EC2 instance, configuring Terraform for EKS,
and deploying the game with a custom Docker image. It also highlights playing the game via a
load balancer URL and managing Kubernetes resources.

71
CHAPTER-3 RESULTS AND DISCUSSION

3.1 Snapshots of Project

Figure 3.1 EC2 Instance

Figure 3.2 IAM Roles

72
Figure 3.3 EKS

Figure 3.4 Kubernetes Running Pods Status

73
Figure 3.5 Load Balancer

Figure 3.6 Deployed Application Super Mario

3.2 Results of Project


This outlines the process of deploying the classic Super Mario game on Amazon EKS using
Terraform. It includes steps like setting up an EC2 instance, configuring Terraform for EKS,
and deploying the game with a custom Docker image. It also highlights playing the game via a
load balancer URL and managing Kubernetes resources.

74
The deployment of the Super Mario game on Amazon Web Services (AWS) using Elastic
Kubernetes Service (EKS) was a noteworthy achievement, marked by several significant
outcomes that enhanced its overall performance and user experience.

• Scalable Infrastructure:

By harnessing the power of AWS EKS alongside Kubernetes, the game was launched in an
environment designed for high scalability. This setup allowed Kubernetes to adeptly manage
numerous game instances, adjusting seamlessly to fluctuations in traffic. As a result, players
experienced smooth and responsive gameplay, regardless of the number of users online at any
given time.

• Automated Deployment:

The project benefited from the adoption of Terraform to provision AWS resources, which,
combined with automated deployment scripts, facilitated a rapid and consistent infrastructure
setup. This automated approach minimized the need for manual interventions, significantly
reducing the likelihood of human error and accelerating the deployment cycle. The result was
a robust system that could be brought online or adjusted with remarkable efficiency.

• Reliability and Availability:

To ensure that players enjoyed continuous access to the game, the architecture incorporated a
LoadBalancer to evenly distribute incoming traffic across the various game instances. This
thoughtful design not only enhanced the performance under load but also bolstered the
reliability of the application, guaranteeing that users could engage with the game without
disruptions, even if individual instances experienced issues or failures.

• Improved Management:

The integration of various AWS services, such as Identity and Access Management (IAM) for
security and Simple Storage Service (S3) for data storage, streamlined the overall management
of resources. Access permissions were easily configured and maintained, ensuring robust
security protocols were in place while enabling efficient operations. This enhancement allowed
the development team to focus more on improving the game itself rather than getting bogged
down with administrative tasks.

75
• Enhanced User Experience:

Ultimately, the seamless deployment process transformed the user experience, allowing players
to access the classic Super Mario game without interruptions or technical hitches. This
combination of nostalgic gameplay with the advantages of modern cloud infrastructure created
a delightful experience for users, blending the charm of the original game with the reliability of
cutting-edge technology.

In summary, the project highlighted how leveraging cloud-native technologies like AWS EKS,
Kubernetes, and Terraform can lead to scalable, reliable, and efficient solutions for hosting
games and applications in a dynamic cloud environment. This initiative not only revitalized a
beloved classic but also set a precedent for future deployments in the gaming industry.

76
CHAPTER-4 CONCLUSION AND FUTURE SCOPE

4.1 Conclusion

The Super Mario game deployment project on AWS, utilizing Elastic Kubernetes Service
(EKS), showcased the immense capabilities of cloud-native technologies in crafting a gaming
infrastructure that is not only scalable but also reliable and automated. By harnessing the power
of Kubernetes alongside various AWS services and Terraform for infrastructure as code, the
project successfully created an environment that can smoothly accommodate fluctuating traffic
demands, ensuring high availability and security for players.

This initiative breathed new life into a beloved classic, emphasizing the vital role that
contemporary tools and cloud platforms play in enhancing operational efficiency and enriching
user experiences. The thoughtful integration of essential AWS services—such as Identity and
Access Management (IAM) to enhance security, Amazon S3 for robust data storage, and EKS
for seamless orchestration of containerized applications—ensured that the game was not only
accessible to users but also protected against potential threats, all while delivering exceptional
performance.

The successful realization of this project underscores the transformative impact of cloud
technologies in addressing real-world challenges related to scalability, reliability, and resource
management. It sets a solid groundwork for future cloud-based game deployments and
applications, paving the way for more innovative ventures in the gaming industry.

77
4.2 Future Scope

The Super Mario game deployment on AWS using EKS lays the foundation for several future
enhancements and expansions:

1. Multiplayer Support: The game can be expanded to support multiplayer functionality,


allowing users to interact and compete in real-time. This would require additional network
configurations and possibly the use of AWS Game Lift or other game server solutions for
matchmaking and session management.

2. Auto-Scaling: Implementing advanced auto-scaling mechanisms in EKS can help


accommodate fluctuating user demand, ensuring optimal performance without manual
intervention. This could involve leveraging Kubernetes Horizontal Pod Autoscaling (HPA) or
integrating AWS Lambda for serverless compute capabilities.

3. Cloud Analytics Integration: By integrating AWS CloudWatch and other analytics tools,
detailed metrics on game performance, user engagement, and system health can be captured.
This would enable better decision-making for future improvements and scaling.

4. Cross-Platform Deployment: Expanding the deployment beyond AWS to other platforms,


such as Google Cloud or Azure, could make the game accessible to a broader audience.
Additionally, integrating mobile and web versions of the game could increase user engagement.

5. Security Enhancements: The project can benefit from further security measures like
encryption of data in transit and at rest, more sophisticated IAM policies, and enhanced access
control for sensitive operations.

6. AI Integration: Adding AI-based features, such as dynamic difficulty adjustments or NPC


behavior improvements, can enhance user experience, making the game more challenging and
interactive.

By exploring these avenues, the project can evolve into a highly scalable, feature-rich, and
globally accessible platform, pushing the boundaries of cloud-based game deployment.

78
REFERENCES

1. Amazon Web Services (AWS) Documentation: Amazon Elastic Kubernetes Service


(EKS). Retrieved from (https://aws.amazon.com/eks/), guide to deploying and managing
Kubernetes clusters on AWS EKS.
2. Kubernetes Documentation: Kubernetes Official Documentation retrieved from
(https://kubernetes.io/docs/),helped in understanding the principles of Kubernetes and its
application in deploying containerized applications.
3. Terraform Documentation: Retrieved from (https://www.terraform.io/docs),used to
manage infrastructure as code and automate the setup of AWS services.
4. Docker Documentation: Docker Official Documentation retrieved from
(https://docs.docker.com/), used to understand Docker containerization and deployment
strategies for the Super Mario game.
5. AWS IAM Documentation: AWS Identity and Access Management (IAM)
Documentation, retrieved from (https://docs.aws.amazon.com/iam/),provided information
on managing permissions and security for AWS resources and services.
6. AWS S3 Documentation: Amazon Simple Storage Service (S3) Documentation, retrieved
from (https://docs.aws.amazon.com/s3/), used to manage storage for game assets, backups,
and logs within the cloud environment.
7. GitHub - k8s-mario Repository: Retrieved from (https://github.com/robin3031/k8s-
mario). This repository provided the code and instructions for deploying the Super Mario
game on Kubernetes via AWS EKS.

79

You might also like