https://github.com/bhuvanyu09/end-to-end-kubernetes-automation-on-aws

Automate Kubernetes deployment on AWS EKS for scalable, cloud-native solutions.

https://github.com/bhuvanyu09/end-to-end-kubernetes-automation-on-aws

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Automate Kubernetes deployment on AWS EKS for scalable, cloud-native solutions.

Basic Info
  • Host: GitHub
  • Owner: bhuvanyu09
  • License: apache-2.0
  • Default Branch: main
  • Size: 622 KB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

End-to-End Kubernetes Automation on AWS

Kubernetes End to End Project on EKS(Amazon Kubernetes Service)

EKS

Prerequisites

kubectl – A command line tool for working with Kubernetes clusters. For more information, see Installing or updating kubectl.

eksctl – A command line tool for working with EKS clusters that automates many individual tasks. For more information, see Installing or updating.

AWS CLI – A command line tool for working with AWS services, including Amazon EKS. For more information, see Installing, updating, and uninstalling the AWS CLI in the AWS Command Line Interface User Guide. After installing the AWS CLI, we recommend that you also configure it. For more information, see Quick configuration with aws configure in the AWS Command Line Interface User Guide.

✅ Project Title: Deploying 2048 Game App on Amazon EKS

✅ Project Description

A Kubernetes End-to-End (E2E) project for deploying a 2048 game app on Amazon Elastic Kubernetes Service (EKS) involves setting up, deploying, and managing the popular 2048 game application on a Kubernetes cluster running on AWS EKS. This project aims to demonstrate how to containerize a web application, deploy it on EKS, manage the cluster, and expose the application to users.

✅ Containerization

I began by containerizing the 2048 game using Docker. This involved creating a Dockerfile to define the application's runtime environment and dependencies, ultimately resulting in a Docker image ready for deployment.

✅ Amazon EKS Setup

I set up an Amazon EKS cluster, configuring the required resources and network settings using AWS services. This step included authentication and permissions setup to interact with the EKS cluster.

✅ Deployment

The containerized 2048 game was deployed on the EKS cluster using Kubernetes. I defined Kubernetes deployment and service YAML files to ensure the application's efficient management and availability.

✅ Scaling and Management

I explored Kubernetes's scaling capabilities, adjusting the number of application replicas based on demand. This ensured the game could handle varying levels of user traffic seamlessly

✅ Application Exposure

To make the 2048 game accessible to users, I created a Kubernetes service to expose it securely over the internet. Additionally, I could have implemented an Ingress controller for more advanced routing

Step 1: Create an EKS cluster

Alt text

Alt text

Step 2: Create an IAM role eks-cluster-role with 1 policy attached: AmazonEKSClusterPolicy

Alt text

Create another IAM role 'eks-node-grp-role' with 3 policies attached: (Allows EC2 instances to call AWS services on your behalf.) - AmazonEKSWorkerNodePolicy - AmazonEC2ContainerRegistryReadOnly - AmazonEKS_CNI_Policy

``` Choose default VPC, Choose 2 or 3 subnets Choose a security group which open the ports 22, 80, 8080 cluster endpoint access: public

For VPC CNI, CoreDNS and kube-proxy, choose the default versions, For CNI, latest and default are

different. But go with default.

Click 'Create'. This process will take 10-12 minutes. Wait till your cluster shows up as Active. ```

Step 3: Add Node Groups to our cluster

Alt text

``` Now, lets add the worker nodes where the pods can run

Open the cluster > Compute > Add NodeGrp Name: -eks-nodegrp-1 Select the role you already created Leave default values for everything else

AMI - choose the default 1 (Amazon Linux 2) change desired/minimum/maximum to 1 (from 2) Enable SSH access. Choose a security group which allwos 22, 80, 8080

Choose default values for other fields

Node group creation may take 2-3 minutes ```

Step 4: Authenticate to this cluster

``` Reference: https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html

Open cloudshell

Type on your AWS CLI window

aws sts get-caller-identity

observe your account and user id details

Create a kubeconfig file where it stores the credentials for EKS:

kubeconfig configuration allows you to connect to your cluster using the kubectl command line.

aws eks update-kubeconfig --region region-code --name my-cluster ex: aws eks update-kubeconfig --region us-east-1 --name unus-eks-cluster-1 # Use the cluster name you just created

see if you can get the nodes you created

kubectl get nodes

Install nano editor in cloudshell. We will need this in the next task

sudo yum install nano -y ```

Step 5: Create a new POD in EKS 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 config file to create the pod

kubectl apply -f 2048-pod.yaml

pod/2048-pod created

view the newly created pod

kubectl get pods ```

Step 6: Setup Load Balancer Service

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

```

apply the config file

kubectl apply -f mygame-svc.yaml ```

```

view details of the modified service

kubectl describe svc mygame-svc ```

```

Access the LoadBalancer Ingress on the kops instance

curl : or curl a06aa56b81f5741268daca84dca6b4f8-694631959.us-east-1.elb.amazonaws.com:80 (try this from your laptop, not from your cloudshell) ```

```

Go to EC2 console. get the DNS name of ELB and paste the DNS into address bar of the browser

It will show the 2048 game. You can play. (need to wait for 2-3 minutes for the

setup to be complete)

```

Alt text

Owner

  • Name: Bhuvanyu Geel
  • Login: bhuvanyu09
  • Kind: user

Hello everyone! I am pursuing my Bachelors of technology from Vellore Institute of Technology in Computer Science and Engineering

GitHub Events

Total
  • Push event: 1
Last Year
  • Push event: 1