Skip to content

An Employee Management Application built with React.js, Node.js, and MySQL, deployed on Amazon EKS using Jenkins as the CI/CD tool.

Notifications You must be signed in to change notification settings

selvanayaki678/employee-portal-crud

Repository files navigation

Employee Management Application Deployment to EKS using Jenkins CICD

An Employee Management Application built with React.js, Node.js, and MySQL, deployed on Amazon EKS using Jenkins as the CI/CD tool.

Application Overview

This Employee Management Application helps organizations streamline employee-related tasks(create,update, delete and view), utilizing a tech stack of React.js for the front end, Node.js for the backend, and MySQL for data storage.

image

Tech Stack

  • React.js
  • Node.js
  • MySQL

Deployment

The application is deployed on Amazon EKS (Elastic Kubernetes Service) using Jenkins for continuous integration and continuous deployment (CI/CD).

Deployment Architecture

employee-management-portal-cicd-flow-diagram

CI/CD Pipeline

  1. Version Control:

    • The source code is hosted on GitHub.
  2. CI/CD with Jenkins:

    • Jenkins automates the CI/CD pipeline, fetching the latest code from GitHub, performing Docker builds, and deploying the application on Amazon EKS.
  3. Static Code Analysis:

    • SonarQube is used for static code analysis, ensuring code quality by identifying and fixing issues.
  4. Docker Build:

    • The application is containerized using Docker. Jenkins initiates Docker builds to create a Docker image.
  5. Image Scan with Trivy:

    • Trivy is employed to scan the Docker image for vulnerabilities, enhancing security.
  6. Docker Image Push:

    • The Docker image is pushed to Docker Hub, making it available for deployment and sharing.
  7. Helm Package for Deployment:

    • Helm is used to package the application for easier deployment and management on Kubernetes clusters.
  8. Monitoring with Prometheus and Grafana:

    • EKS is monitored using Prometheus and Grafana to provide insights into the performance and health of the application.

Getting Started

To run application locally as container

  1. Clone the repository:

  2. Prerequisites

    • Mysql instance
    • Reactjs,Npm
    • java,maven
    • Docker
  3. Mysql setup

    • Install mysql
    • Login to mysql using mysql -u root -h localhost --password
    • Create Database --> create database employee_management_system;
  4. Build a Java Docker image

    • To configure MySQL endpoint(username, and password) in source code , Go to employee-portal-crud/springboot-backend/src/main/resources/application.properties file and add mysql endpoint url.
    • Best practice is to keep these as environment variables rather than hardcoding.
    • To build a docker image; cd employee-portal-crud/springboot-backend/;Run mvn clean install;docker build -t dockerimagename:version .
  5. Build a react image

    • To congifure java endpoint in react source code, go to react-frontend/src/services/EmployeeService.js file and add javaendpoint url
    • Build docker image : cd react-frontend; docker build -t <reactjs_docker_image:version> .
  6. Running containers

    • docker run -dit --name react-app -p 3000:3000
    • docker run -dir --name java-app -p 8080:8081

Note:Mysql needs to allow connections from java endpoint(ip) - To allow connections from a specific IP address to the MySQL local instance, execute the following commands inside the MySQL database:
- CREATE USER 'root'@'ip_address' IDENTIFIED BY 'some_pass';
- GRANT ALL PRIVILEGES ON . TO 'root'@'ip_address';
- SELECT user,host from mysql.user;

To Run application in EKS

  1. Create EKS and RDS instance

  2. Deploying Nginx ingress controller,Prometheus and sonarqube in EKS

  3. Deploying React and Java application in EKS using Jenkins

    • Configured all build and deploy (CI/CD)steps in jenkinsfile to deploy application into EKS
  4. Monitoring EKS using Prometheus and Grafana

    • Configured Prometheus in EKS using Helm chart, without downloading Prometheus from the official website. Followed the steps provided in this link for setting up Prometheus: https://devopscube.com/setup-prometheus-monitoring-on-kubernetes/.

    • Prometheus targets include kube state metrics and cAdvisor.
      Grafana:

    • Installed Grafana on the local machine.

    • Configured the datasource as Prometheus.

    • Grafana dashboard: 13332 - kube state metrics.
      Developed custom queries to obtain the count of pods, running pods, and failed pods in a specific namespace.\

  5. To access application publicly using custom url

    • In Route 53, created a DNS entry to associate our custom URL with the IP address of the Nginx Ingress controller.

Application Deployment with screenshots

Application CICD execution

image

Docker Hub Application Images

image

Application in EKS

image

Route 53 Configuration

image

SonarQube

image

Prometheus

image image

Grafana Dashboard

Pod Metrics image

Cluster node Usage image

About

An Employee Management Application built with React.js, Node.js, and MySQL, deployed on Amazon EKS using Jenkins as the CI/CD tool.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published