Giter VIP home page Giter VIP logo

devops-final-project-app's Introduction

Application for EKS cluster

Prerequisites

  • Docker
  • ArgoCD
  • AWS CLI
  • Kubectl
  • MongoDB Atlas Cluster

Description

The solution is a simple web application that allows users to create, read, update and delete (CRUD) a TODO list. The application is composed of a front-end, a back-end and a MongoDB database. The front-end is a React application that allows users to interact with the application. The back-end is a Node.js application that handles the requests from the front-end and communicates with the database. The database is a MongoDB database that stores the information.

argo

Usage

For this project, the ECR will be created manually, so it is independent of the infrastructure built with Terraform. You can check the infrastructure repository here

To create the ECR repository, run the following command:

Note: Make sure to have an IAM user setup with the correct permissions to create and push to ECR in AWS CLI.

aws ecr create-repository --repository-name rest-api --image-scanning-configuration scanOnPush=true --image-tag-mutability IMMUTABLE --region us-east-1

Build and push the Docker image

  1. Build the Docker image using the following command:

Note: You can pull the image from Docker Hub using the following command: docker pull waltergaitan/mern-stack

docker build -t mern-image .  
  1. Test the image locally using the following command:
docker run -p 80:80 mern-image

After the image is running, navigate to http://localhost:80 in your web browser to verify that the application is running.

  1. Create an ECR repository using the following command:
aws ecr create-repository --repository-name <repository-name> --image-scanning-configuration scanOnPush=true --image-tag-mutability IMMUTABLE --region us-east-1
  1. Authenticate Docker to your Amazon ECR registry using the following command:
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <aws_account_id>.dkr.ecr.us-east-1.amazonaws.com
  1. Tag your image using the following command:
docker tag mern-stack:latest <Repository URI>/<repository-name>:v1
  1. Push the image to your Amazon ECR repository using the following command:
docker push <Repository URI>/mern-stack:v1

Connect to the EKS cluster

  1. Create an EKS cluster using the repository Terraform EKS Cluster

  2. Connect to the EKS cluster using the following command:

rm ~/.kube/config
aws eks --region us-east-1 update-kubeconfig --name mern-stack-<terraform.workspace>-eks

Next, you can find further information about using the k8s manifests and ArgoCD to deploy the application inside their respective folders. I recommend you to check the ArgoCD folder first, since it is the easiest way to deploy the application.

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.