Skip to content

KoliAtul/Project-Super-Mario

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 

Repository files navigation

$$\color{green}{\textbf Project: 🎮 \color{red} \textbf {Super} \ \color{orange} \ \textbf Mario \ \textbf Bros 🍄🐢}$$

$\color{blue} \textbf {Project Workflow}$

Step 1 → Login and basics setup

Step 2 → Setup Docker ,Terraform ,aws cli , and Kubectl

Step 3 → IAM Role for EC2

Step 4 →Attach IAM role with your EC2

Step 5 → Building Infrastructure Using terraform

Step 6 → Creation of deployment and service for EKS

$\color{red} \textbf {Step 1 → Login and basics setup}$

  1. Click on launch Instance instance
  2. Connect to EC2-Instance connect-ec2

$\color{red} \textbf {Step 2 → Setup Tools}$

sudo apt update -y

$\color{blue} \textbf {Setup Docker:}$

sudo apt install docker.io
sudo systemctl start docker
sudo usermod -aG docker ubuntu
newgrp docker
docker --version

$\color{blue} \textbf {Setup Terraform:}$

sudo apt-get update && sudo apt-get install -y gnupg software-properties-common

wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null

gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
--fingerprint

echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/hashicorp.list

sudo apt update
sudo apt-get install terraform
terraform --version

${\color{blue} \textbf {Setup AWS CLI:}}$

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo apt install unzip 
unzip awscliv2.zip
sudo ./aws/install
aws --version

${\color{blue} \textbf {Install kubectl}}$

Download the latest release with the command:

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

Validate the binary

 curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"

Validate the kubectl binary against the checksum file:

echo "$(cat kubectl.sha256)  kubectl" | sha256sum --check

Install kubectl:

sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

Note: If you do not have root access on the target system, you can still install kubectl to the ~/.local/bin directory:

chmod +x kubectl
mkdir -p ~/.local/bin
mv ./kubectl ~/.local/bin/kubectl
kubectl version --client

$\color{red} \textbf {Step 3 → IAM Role for EC2}$

create role: role

$\color{red} \textbf {Step 4 →Attach IAM role with your EC2 }$

go to EC2 click on actions → security → modify IAM role option

  • administrator access
  • eks

role-ec2

modify-role

$\color{red} \textbf {Step 5 → Building Infrastructure Using terraform}$

$\color{blue} \textbf {Install GIT}$

sudo apt install git -y
git clone https://github.com/abhipraydhoble/Project-Super-Mario.git
cd Project-Super-Mario
cd EKS-TF
vim backend.tf

backend tf

$\color{blue} \textbf {Create \ Infra:}$

terraform init
terraform validate
terraform plan
terraform apply --auto-approve
aws eks update-kubeconfig --name EKS_CLOUD --region ap-south-1

$\color{red} \textbf {Step 6 → Creation of deployment and service for EKS}$

change the directory where deployment and service files are stored use the command →

cd ..

$\color{blue} \textbf {create the deployment}$

kubectl apply -f deployment.yaml

$\color{blue} \textbf {Now create the service}$

kubectl apply -f service.yaml
kubectl get all
kubectl get svc mario-service

copy the load balancer ingress and paste it on browser and your game is running

load balancer

$\color{green} \textbf {Final Output: Enjoy The Game 🎮}$

output

Delete Infra

 terraform destroy -auto-approve

About

Project using K8's

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages