Part1: Deploying a gaming application on an EKS cluster with ingress controller

Part1: Deploying a gaming application on an EKS cluster with ingress controller

Creating an EKS cluster with Fargate profile

·

3 min read

Hi everyone! In today's blog we shall deploy a gaming application in an EKS cluster and make this application accessible to the outside world via the k8s Ingress controller

This has to be one of those projects that made me learn so many new concepts on a new horizon and made me understand why having hands-on is as equal to having strong theoretical knowledge in DevOps, especially Kubernetes.

We shall start with the project.

As already mentioned, we will be deploying this application in AWS EKS which takes away the worry of managing the master nodes. For the worker nodes, we will be using Fargate this time instead of EC2 instances, so let us first understand why are we choosing Fargate over EC2.

  1. Infrastructure Management: AWS Fargate is a serverless compute meaning we do not have to worry about the underlying infrastructure of our computing instance and AWS takes care of it

  2. Cost: Fargate only charges for the amount of time, the application is being used based on vCPU and memory allocation per second ie the actual time the application was accessed instead of being charged for all the time the instance is being run as in EC2

  3. Scalability: AWS takes care of the scalability of the instance based on the workload for our application instead of having to do it manually with the help of autoscaling as in EC2

  4. DevOps Automation: Fargate integrates seamlessly with container orchestration services like Amazon Elastic Kubernetes Service (EKS) and Amazon Elastic Container Service (ECS), making it a preferred choice.

Now, we shall install all the pre-requisites for this project,

Pre-requisites:

Next, we shall create and configure an IAM user who can access the EKS cluster. I am giving administrator access to this user since this project requires many permissions but it is always recommended to provide the IAM user with the minimum permissions.

  1. Create an IAM user on AWS and create access keys.

    1. Go to the AWS IAM console.

    2. Create a new IAM user with the name you wish

    3. Attach the "AdministratorAccess" policy to this user.

    4. Create Security Credentials: After creating the user, generate an Access Key and Secret Access Key for this user.

  2. Configure the cli for this user

Now we have all the pre-requisites ready and we shall start with the actual project

  1. Create an EKS cluster with the worker node on fargate instances. It takes around 15 to 20 mins for AWS to create the cluster once you input the command

     eksctl create cluster --name gaming2048 --region us-east-1 --fargate
    

  2. The cluster is now up and running, let us now upadate the config file and connect to this cluster

     aws eks update-kubeconfig --name gaming2048
    

  3. Now, we shall create a new create a new fargate profile game-2048 within this cluster on which we will deploy the load balancer

     eksctl create fargateprofile \
         --cluster gaming2048 \
         --region us-east-1 \
         --name alb-gaming-app \
         --namespace game-2048
    

    So the cluster is up and running and is ready for the application to be deployed. In the next blog we shall move onto deploying the resources in the EKS cluster