Explored the deployment of a 2048 Game Application on AWS EKS
Tags: eks, kubernetes, fargate, aws
Published: 2023-12-05 03:17:56

🚀 Completed an end-to-end Kubernetes project. Explored the deployment of a 2048 Game Application on AWS EKS (Elastic Kubernetes Service) using Fargate and an Application Load Balancer Ingress Controller.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4mjhcthfwa46g30zuna.gif)

`🛠️ Steps involved:`
1. Set up prerequisites: Install awscli, eksctl, and kubectl,helm 
2. Installed EKS with Fargate.
**ekctl create cluster --name <cluster-name> --region <region-name> --fargate
Note:: fargate is serverless computing service like aws lamda,choosing fargate service other than ec2 is cost optimized
3. Acquired or updated the KubeConfig file for CLI access to cluster resources.
**aws eks update-kubeconfig --name <cluster-name> --region <region-name>
4. For deploying the pods other then the default namespaces we need to create the new namespace..for this deploy the new fargate profile and allow the pods to run on the new namespace ..
**for eg namespace :: game-2048.
5.Create the custom fargate profile allowing the namespace created to deploy the pods in that..
eksctl create fargateprofile \
 --cluster prod-web-hyd-eks \
 --region=ap-south-2 \
 --name fargate-1 \
 --namespace game-2048
5. Deployed the 2048 app as a K8s Pod, created a corresponding service, and set up an Ingress resource for traffic routing.
kubectl apply -f <file.yaml>
6. Implemented the Ingress Controller to automate ALB Controller creation.
7. Established an IAM OIDC Provider to grant ALB Controller access to the Application Load Balancer.
8. Created a service account with an IAM Role and Policy for Load Balancer access.
$ eksctl create iamserviceaccount --cluster=prod-web-hyd-eks --namespace=game-2048 --name=aws-load-balancer-controller --role-name awsELKloadbalancerRole --attach-policy-arn=<policy-arn> --approve
9. Deployed ALB Controller using Helm Charts, interfacing with the service account.
helm install aws-load-balancer-controller eks/aws-load-balancer-controller \ 
 -n game-2048 \
 --set clusterName=<cluster-name> \
 --set serviceAccount.create=false \
 --set serviceAccount.name=<serviceaccount-name> \
 --set region=<region-name> \
 --set vpcId=<vpc-id>
10. Accessed the deployed 2048 application with the DNS URL of the Load Balancer in the public subnet.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ba4w0o7i0pyo1bqt4uok.gif)

[linkedin](www.linkedin.com/in/swapnil-m-2424sm)
[GitHub](https://github.com/SwapnilM24)

```
#kubernetes 
#AWS 
#EKS 
#DevOps
#CloudComputing .🎮🚢
```


![2048 Game Application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/neht76owfvvwx5pblq97.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ioyw2lg4wltprphy67zn.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycecq925a7zw1ealyxav.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ly93fvoosn6it7n93h1r.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1qtbc6kd0rlgsp2ohp6x.png)