Deploying the 2️⃣0️⃣4️⃣8️⃣ Game on AWS EKS to continue ☁️☸️

ShudhoShudho
3 min read

Introduction

In today’s cloud-native landscape, Kubernetes has become the de facto standard for container orchestration. AWS Elastic Kubernetes Service (EKS) offers a managed solution, simplifying cluster setup and management. In this blog, we’ll walk through deploying the popular 2048 game on EKS, leveraging AWS Fargate for serverless compute and integrating the AWS Application Load Balancer (ALB) Ingress Controller for seamless external access.

Understanding EKS and Its Components

EKS abstracts away much of the complexity of Kubernetes management. The control plane, managed by AWS, includes critical components such as the API server, etcd, scheduler, controllers, and the cloud controller manager. For compute, EKS supports both EC2 and Fargate, with Fargate providing a serverless experience for running containers.

Why Use an Ingress Controller?

Ingress Controllers act as load balancers, routing external traffic to services within your Kubernetes cluster. AWS’s ALB Ingress Controller is particularly powerful, offering features like TLS termination, autoscaling, logging, and integration with AWS IAM for fine-grained access control.

Step-by-Step Deployment

  • 1. Creating the EKS Cluster

    We use eksctl, a command-line utility, to provision the EKS cluster with Fargate support:

    eksctl create cluster --name project-2048 --region us-east-1 --fargate

      eksctl create cluster --name project-2048 --region us-east-1 --fargate
    

    This automates the creation of networking resources and the Kubernetes control plane.

    EKS-Cluster [ project-2048 ]

  • 2. Setting Up Fargate Profiles

    Since we are using AWS Fargate for running our workloads, it's important to understand how Fargate Profiles work. A Fargate Profile in EKS is essentially a way to define which pods should run on Fargate instead of EC2 worker nodes. It acts as an isolation boundary, typically defined by a combination of namespace and optional label selectors.

      eksctl create fargateprofile --cluster project-2048 --region us-east-1 --name alb-ample-app --namespace project-2048
    

    Seperate Fargate Profile created for Application [ project-2048 ]

    3. Deploying the Application

    The deployment involves three manifest files:

    • deployment.yaml: Defines the pod specifications, including the container image and replica count.

    • service.yaml: Exposes the pods internally via a Kubernetes Service.

    • ingress.yaml: Configures external access, specifying routing rules and the ingress controller.

Application Deployed in "project-2048" namespace

4. Enabling IAM OIDC Provider

But how does the Ingress Controller running inside Kubernetes create an AWS ALB (Application Load Balancer)? After all, creating resources in AWS requires authentication via IAM roles or users. This is where IAM OIDC (OpenID Connect) provider integration comes into play. By default, an EKS cluster doesn’t have an OIDC provider associated with it — but you can easily attach one using a simple command. This setup allows Kubernetes pods (like the AWS Load Balancer Controller) to assume IAM roles and create AWS resources like ALBs securely and dynamically.

    eksctl utils associate-iam-oidc-provider --cluster project-2048 --approve

5. Creating IAM Policy and Service Account

Download the recommended IAM policy for the ALB Ingress Controller:

    curl -O https://kubernetes-sigs.github.io/aws-load-balancer-controller/v1.1/examples/iam-policy.json
       aws iam create-policy --policy-name AWSLoadBalancerControllerIAMPolicy --policy-document file://iam-policy.json

Create a Kubernetes service account and attach the IAM role:

    eksctl create iamserviceaccount --cluster=project-2048 --namespace=kube-system --name=aws-load-balancer-controller --role-name AmazonEKSLoadBalancerControllerRole --attach-policy-arn=arn:aws:iam::802406433010:policy/AWSLoadBalancerControllerIAMPolicy --approve

6. Installing the ALB Ingress Controller

Add the EKS Helm chart repository and install the controller:

    helm repo add eks https://aws.github.io/eks-charts
    helm repo update eks
    helm install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName=project-2048 --set serviceAccount.create=false --set serviceAccount.name=aws-load-balancer-controller --set region=us-east-1 --set vpcId=<your-vpc-id>

alb controller getting deployed on EKS-Cluster

7. Confirming the Deployment

Once installed, the ALB Ingress Controller automatically provisions an ALB based on your ingress resources. You’ll see confirmation messages indicating successful deployment.

Accessing Application via Application Load Balancer on Browser

Conclusion

By following these steps, you can deploy applications on AWS EKS with robust, scalable, and secure external access via the ALB Ingress Controller. This approach leverages AWS’s managed services, reducing operational overhead and enabling rapid, reliable application delivery.

GitHub Repo - https://github.com/shudhoo/Project-2048-EKS.git

0
Subscribe to my newsletter

Read articles from Shudho directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shudho
Shudho

Hi, I’m Shudhodhan 🎯 — A passionate Cloud ☁️ and DevOps ♾️ learner, focused on applying skills to build, scale, and automate modern software development and deployment workflows. With a Strong foundation in IaC, Containerization 🐋 & Orchestration ☸️ with Kubernetes and Terraform. Capable of building and maintaining Cloud Native Applications on AWS ☁️. Skilled in designing and automating CI/CD 🔧 pipelines using Jenkins and GitHub Actions, supporting scalable deployments for both microservices and monolithic applications.