Giter VIP home page Giter VIP logo

three-tier-eks-iac's Introduction

three-tier-eks-iac

Prerequisite

Install Kubectl https://kubernetes.io/docs/tasks/tools/

Install Helm https://helm.sh/docs/intro/install/

helm repo update

Install/update latest AWS CLI: (make sure install v2 only) https://aws.amazon.com/cli/

#update the Kubernetes context aws eks update-kubeconfig --name my-eks-cluster --region us-west-2

verify access:

kubectl auth can-i "*" "*"
kubectl get nodes

Verify autoscaler running:

kubectl get pods -n kube-system

Check Autoscaler logs

kubectl logs -f \
  -n kube-system \
  -l app=cluster-autoscaler

Check load balancer logs

kubectl logs -f -n kube-system \
  -l app.kubernetes.io/name=aws-load-balancer-controller

Buid Docker image :

For Mac:

export DOCKER_CLI_EXPERIMENTAL=enabled
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/w8u5e4v2

Buid Front End :

docker buildx build --platform linux/amd64 -t workshop-frontend:v1 . 
docker tag workshop-frontend:v1 public.ecr.aws/w8u5e4v2/workshop-frontend:v1
docker push public.ecr.aws/w8u5e4v2/workshop-frontend:v1

Buid Back End :

docker buildx build --platform linux/amd64 -t workshop-backend:v1 . 
docker tag workshop-backend:v1 public.ecr.aws/w8u5e4v2/workshop-backend:v1
docker push public.ecr.aws/w8u5e4v2/workshop-backend:v1

For Linux/Windows:

Buid Front End :

docker build -t workshop-frontend:v1 . 
docker tag workshop-frontend:v1 public.ecr.aws/w8u5e4v2/workshop-frontend:v1
docker push public.ecr.aws/w8u5e4v2/workshop-frontend:v1

Buid Back End :

docker build -t workshop-backend:v1 . 
docker tag workshop-backend:v1 public.ecr.aws/w8u5e4v2/workshop-backend:v1
docker push public.ecr.aws/w8u5e4v2/workshop-backend:v1

Create Namespace

kubectl create ns workshop

kubectl config set-context --current --namespace workshop

MongoDB Database Setup

To create MongoDB Resources

cd k8s_manifests/mongo_v1
kubectl apply -f secrets.yaml
kubectl apply -f deploy.yaml
kubectl apply -f service.yaml

Backend API Setup

Create NodeJs API deployment by running the following command:

kubectl apply -f backend-deployment.yaml
kubectl apply -f backend-service.yaml
``


**Frontend setup**

Create the Frontend  resource. In the terminal run the following command:

kubectl apply -f frontend-deployment.yaml kubectl apply -f frontend-service.yaml


Finally create the final load balancer to allow internet traffic:

kubectl apply -f full_stack_lb.yaml



# Any issue with the pods ? check logs:
kubectl logs -f POD_ID -f


# Grafana setup 
Username: admin
Password: prom-operator

Import Dashboard ID: 1860

Exlore more at: https://grafana.com/grafana/dashboards/

three-tier-eks-iac's People

Contributors

sd031 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.