Skip to content

cloudOpsgenius/Eks-Project

Repository files navigation

#EksProject

Overview

This repository hosts the #EksProject for the TWS community. The challenge involves deploying a Three-Tier Web Application using ReactJS, NodeJS, and MongoDB on AWS EKS. Participants are encouraged to deploy the application, add creative enhancements, and submit a Pull Request (PR). Merged PRs will be eligible for exciting prizes!


Prerequisites

  • Basic knowledge of Docker and AWS services.
  • An AWS account with the necessary permissions.

Challenge Steps

  1. Application Code
  2. Jenkins Pipeline Code
  3. Jenkins Server Terraform
  4. Kubernetes Manifests Files
  5. Project Details

Application Code

The Application-Code directory contains the source code for the Three-Tier Web Application, including both frontend and backend implementations.

Jenkins Pipeline Code

Explore the Jenkins-Pipeline-Code directory for Jenkins pipeline scripts to automate CI/CD for this project.

Jenkins Server Terraform

The Jenkins-Server-TF directory contains Terraform scripts to set up the Jenkins server on AWS, simplifying infrastructure provisioning.

Kubernetes Manifests Files

The Kubernetes-Manifests-Files directory holds the necessary Kubernetes manifests for deploying the application on AWS EKS. Customize these files to suit your deployment needs.


Project Details

🛠️ Tools Explored:

  • Terraform & AWS CLI for AWS infrastructure
  • Jenkins, SonarQube, Terraform, and Kubectl for CI/CD setup
  • Helm, Prometheus, and Grafana for monitoring
  • ArgoCD for GitOps practices

🚢 High-Level Overview:

  • IAM user setup & Terraform-based AWS infrastructure provisioning
  • Jenkins deployment with AWS integration
  • EKS Cluster creation & Load Balancer configuration
  • Private ECR repositories for secure image management
  • Helm charts for efficient monitoring setup
  • GitOps with ArgoCD for version control-driven deployments

📈 Journey Highlights: This project covers setting up tools, deploying a Three-Tier app, ensuring data persistence, and implementing CI/CD pipelines from scratch.


Getting Started

For a detailed walkthrough, refer to our guide on medium, covering everything from IAM setup to EKS configuration.


Step-by-Step Instructions

Step 1: IAM Configuration

  1. Create an IAM user, eks-admin, with AdministratorAccess.
  2. Generate Security Credentials (Access Key and Secret Access Key).

Step 2: EC2 Setup

  1. Launch an Ubuntu instance in your preferred region (e.g., us-west-2).
  2. SSH into the instance.

Step 3: Install AWS CLI v2

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo apt install unzip
unzip awscliv2.zip
sudo ./aws/install -i /usr/local/aws-cli -b /usr/local/bin --update
aws configure

Step 4: Install Docker

sudo apt-get update
sudo apt install docker.io
docker ps
sudo chown $USER /var/run/docker.sock

Step 5: Install kubectl

curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin
kubectl version --short --client

Step 6: Install eksctl

curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
eksctl version

Step 7: Setup EKS Cluster

eksctl create cluster --name three-tier-cluster --region us-west-2 --node-type t2.medium --nodes-min 2 --nodes-max 2
aws eks update-kubeconfig --region us-west-2 --name three-tier-cluster
kubectl get nodes

Step 8: Run Kubernetes Manifests

kubectl create namespace workshop
kubectl apply -f Kubernetes-Manifests-Files
kubectl delete -f Kubernetes-Manifests-Files

Step 9: Install AWS Load Balancer

curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.5.4/docs/install/iam_policy.json
aws iam create-policy --policy-name AWSLoadBalancerControllerIAMPolicy --policy-document file://iam_policy.json
eksctl utils associate-iam-oidc-provider --region=us-west-2 --cluster=three-tier-cluster --approve
eksctl create iamserviceaccount --cluster=three-tier-cluster --namespace=kube-system --name=aws-load-balancer-controller --role-name AmazonEKSLoadBalancerControllerRole --attach-policy-arn=arn:aws:iam::626072240565:policy/AWSLoadBalancerControllerIAMPolicy --approve --region=us-west-2

Step 10: Deploy AWS Load Balancer Controller

sudo snap install helm --classic
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=three-tier-cluster --set serviceAccount.create=false --set serviceAccount.name=aws-load-balancer-controller
kubectl get deployment -n kube-system aws-load-balancer-controller
kubectl apply -f full_stack_lb.yaml

Cleanup

To delete the EKS cluster, use:

eksctl delete cluster --name three-tier-cluster --region us-west-2

Contribution Guidelines

  • Fork the repository and create a feature branch.
  • Deploy the application, add your enhancements, and ensure your code adheres to the project's style.
  • Submit a PR with a detailed description of your changes.

Support

For any queries or issues, please open an issue in the repository.


Happy Learning! 🚀👨‍💻👩‍💻

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published