$$\color{green}{\textbf Project: 🎮 \color{red} \textbf {Super} \ \color{orange} \ \textbf Mario \ \textbf Bros 🍄🐢}$$
sudo apt update
sudo apt install docker .io
sudo systemctl start docker
sudo usermod -aG docker ubuntu
newgrp docker
docker --version
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
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
Download latest version with this command
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
curl is a command-line tool for transferring data from a server. -LO -L: Follow redirects if the URL redirects to another location. -O: Save the file with its original name (in this case, kubectl). https://dl.k8s.io/release/$(...) - The URL specifies where the kubectl binary is hosted. $(...) - This is command substitution in Bash. It executes the command inside the parentheses and substitutes the output. curl -L -s https://dl.k8s.io/release/stable.txt - This inner curl command fetches the latest stable Kubernetes version from the file stable.txt hosted on the Kubernetes server. The -s option makes it silent, so it suppresses unnecessary output. /bin/linux/amd64/kubectl bin: Indicates it's a binary file. linux/amd64: Specifies the platform as Linux and the architecture as AMD64 (common for most modern 64-bit CPUs). kubectl: The Kubernetes command-line tool being downloaded.
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
insatll Kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
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
go to EC2 click on actions → security → modify IAM role option
sudo apt install git -y
git clone https://github.com/aamage20/Super-Mario.git
cd Super-Mario
cd EKS-Terraform
vim backend.tf
terraform init
terraform plan
terraform apply --auto-approve
aws eks update-kubeconfig --name EKS_CLOUD --region us-west-1 --profile eks
change the directory where deployment and service files are stored use the command →
cd ..
kubectl apply -f deployment.yaml
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
Delete Infra
terraform destroy -auto-approve