๐ŸŽฎ PLAY Super Mario Game on AWS-EKS

๐ŸŽฎ PLAY Super Mario Game on AWS-EKS

ยท

2 min read

๐ŸŽ‡ Introduction:

In this tutorial, we'll embark on an exciting journey of setting up the classic Super Mario game on Kubernetes. Leveraging the power of AWS and Kubernetes, we'll create a Kubernetes cluster using Kubeadm. Get ready for a nostalgic adventure in containers and cloud orchestration!

โœ” Tools Involved:

  • AWS (Amazon Web Services)

  • Kubernetes

โœ” GitHub:

https://github.com/dushyantkumark/k8s-mario-project.git

โœ” AWS-EKS-CLUSTER-SETUP:

https://dushyantkumark.hashnode.dev/set-up-your-eks-cluster-like-a-game

๐ŸŽ‡ Create Manifest files -

Create a deployment.yml file.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mario-deployment
  namespace: super-mario  
spec:
  replicas: 2  
  selector:
    matchLabels:
      app: mario
  template:
    metadata:
      labels:
        app: mario
    spec:
      containers:
      - name: mario-container
        image: dushyantkumark/mario-game:latest
        ports:
        - containerPort: 80

Create services.yml file.

apiVersion: v1
kind: Service
metadata:
  name: mario-service
  namespace: super-mario
spec:
  type: LoadBalancer
  selector:
    app: mario
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80

๐ŸŽ‡ K8s Commands

Check the number of nodes available.

kubectl get no
or
kubectl get nodes

Before applying manifest, first, we have to check namespaces available in k8s and then create a particular namespace (super-mario).

kubectl get ns
kubectl create namespace super-mario
or
kubectl create ns super-mario

Apply Manifest configuration files deployment.yaml and service.yaml files.

kubectl apply -f deployment.yaml 
kubectl apply -f services.yaml

Check running pods and services on a super-mario namespace.

kubectl get po -n super-mario
or 
kubectl get pods -n super-mario
kubectl get svc -n super-mario

If you want to check all the resources available such as deployment, pods, services, and replicaset in a particular namespace (super-mario).

kubectl get all -n super-mario

Now you enjoy your game application :-)

๐ŸŽกNOTE: Cluster Creation & Deletion Commands

Perform the cleanup once you are done with the project.

EKS-Cluster creation command

eksctl create cluster --name mario-cluster --region ap-south-1 --node-type t2.medium --nodes-min 2 --nodes-max 4

EKS-Cluster deletion command

eksctl delete cluster --name mario-cluster

\...................................................................................................................................................

The above information is up to my understanding. Suggestions are always welcome. Thanks for reading this article.๐Ÿ˜Š

#aws #cloudcomputing #docker #Devops #kubernetes #TrainWithShubham #90daysofdevopsc #happylearning

Follow for many such contents:

LinkedIn: linkedin.com/in/dushyant-kumar-dk

Blog: dushyantkumark.hashnode.dev

ย