Deploying a 2048 Game on Kubernetes using Amazon EKS — End-to-End DevOps Project

Published: (March 6, 2026 at 11:30 PM EST)
5 min read
Source: Dev.to

Source: Dev.to

Project Goal

  • Containerize the application
  • Deploy it on a Kubernetes cluster
  • Expose it to the Internet
  • Understand how Kubernetes workloads run in a real cloud environment

GitHub Repository:
👉

Project Architecture Overview

The workflow follows a typical Kubernetes deployment lifecycle:

  1. Containerize the application with Docker
  2. Create an Amazon EKS cluster
  3. Configure IAM roles and worker nodes
  4. Deploy the application using Kubernetes manifests
  5. Expose the application with a LoadBalancer service
  6. Access the application from the Internet

Prerequisites

Before starting, install and configure the following tools:

ToolPurpose
kubectlCLI for interacting with Kubernetes clusters (deploy apps, inspect resources, manage the cluster).
eksctlSimplifies creation and management of Amazon EKS clusters (automates many AWS resources).
AWS CLIAllows direct interaction with AWS services; used to authenticate with EKS and update the kubeconfig file.

Once these tools are ready, you can begin building the Kubernetes environment.

Step 1 – Create an Amazon EKS Cluster

An EKS cluster consists of two main components:

  • Control Plane – Managed by AWS
  • Worker Nodes – EC2 instances where pods run

When creating the cluster, configure:

  • Default VPC
  • 2–3 subnets
  • Security groups
  • Public cluster endpoint access

Cluster creation typically takes 10–12 minutes. When the status becomes Active, proceed to the next step.

Step 2 – Create IAM Roles

AWS services rely heavily on IAM roles and permissions. Two roles are required:

1. EKS Cluster Role

Allows the Kubernetes control plane to interact with other AWS services.

Policy attached: AmazonEKSClusterPolicy

2. Node Group Role

Provides worker nodes permission to communicate with AWS services.

Policies attached:

AmazonEKSWorkerNodePolicy
AmazonEC2ContainerRegistryReadOnly
AmazonEKS_CNI_Policy

These permissions enable nodes to:

  • Pull container images from ECR
  • Communicate with the control plane
  • Manage networking via the CNI plugin

Step 3 – Add Worker Nodes

Create a Node Group to host the pods.

SettingValue
AMIAmazon Linux 2
Desired nodes1 (can be scaled later)
Security group ports22, 80, 8080
SSH accessEnabled

After a few minutes the node group becomes Active and ready for workloads.

Step 4 – Authenticate with the Cluster

Update your local kubeconfig so kubectl can talk to the cluster:

aws eks update-kubeconfig --region us-east-1 --name my-cluster

This command stores the cluster credentials locally.

Verify the connection

kubectl get nodes

If the nodes are listed, the cluster is correctly configured.

Step 5 – Deploy the 2048 Game Pod

Create a pod definition for the 2048 game:

apiVersion: v1
kind: Pod
metadata:
  name: 2048-pod
  labels:
    app: 2048-ws
spec:
  containers:
  - name: 2048-container
    image: blackicebird/2048
    ports:
    - containerPort: 80

Apply the manifest:

kubectl apply -f 2048-pod.yaml

Check the pod status:

kubectl get pods

When the pod shows Running, the application is successfully deployed inside the cluster.

Step 6 – Expose the Application

Create a LoadBalancer service to make the game reachable from the Internet:

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

Apply the service:

kubectl apply -f 2048-service.yaml

After a few moments AWS provisions an ELB. Retrieve its DNS name:

kubectl get svc 2048-service

Open the DNS name in a browser – the 2048 game should be fully functional.

Additional Details for Exposing the Application

Step 6 diagram

Although the pod is running, it is not yet accessible from outside the cluster. To solve this, we create a Kubernetes Service:

apiVersion: v1
kind: Service
metadata:
  name: mygame-svc
spec:
  selector:
    app: 2048-ws
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: LoadBalancer

Deploy the service:

kubectl apply -f mygame-svc.yaml

Check the service details:

kubectl describe svc mygame-svc

Kubernetes will automatically provision a public LoadBalancer.

Step 7 — Accessing the Application

After the LoadBalancer is created, AWS generates a public DNS endpoint. Open that DNS name in a browser – the 2048 game interface appears and the application becomes publicly accessible.

2048 game UI

Scaling the Application

One of the biggest advantages of Kubernetes is horizontal scaling. If traffic increases, additional replicas can be created:

kubectl scale deployment my-app --replicas=3

Kubernetes will automatically distribute traffic across the pods, ensuring high availability and improved performance.

What I Learned from This Project

  • Kubernetes Workloads – How pods run containerized applications inside a cluster.
  • Managed Kubernetes – How Amazon EKS simplifies cluster management by handling the control plane.
  • Networking in Kubernetes – How services and load balancers expose applications externally.
  • Cloud Infrastructure – How AWS integrates networking, compute, and container orchestration together.

Possible Improvements

  • Using Deployments instead of standalone pods.
  • Implementing Ingress controllers.
  • Adding CI/CD pipelines.
  • Monitoring with Prometheus and Grafana.
  • Infrastructure automation using Terraform.

These additions would bring the project closer to a production‑grade Kubernetes deployment.

Final Thoughts

Kubernetes can seem overwhelming at first, but projects like this make it much easier to understand how everything fits together. By deploying a simple application like the 2048 game, we can clearly see how:

  • Containers run inside pods.
  • Pods run on worker nodes.
  • Services expose applications.
  • Load balancers provide external access.

If you are learning DevOps, Kubernetes, or Cloud Engineering, building projects like this is one of the best ways to gain practical experience.

Project Repository

Explore the code, YAML manifests, and setup steps in the complete project repository:

Project screenshot

👉 https://shorturl.at/LxtaW

0 views
Back to Blog

Related posts

Read more »

AWS Offerings 2025

With all the different cloud providers, it can be challenging to get a clear visual overview of the available offerings. Below are the December 2025 AWS cloud s...

Hands-On With Kubernetes 1.35

Kubernetes 1.35 was released on December 17, 2025, bringing significant improvements for production workloads, particularly in resource management, AI/ML schedu...