Mastering CI/CD with Jenkins: Deploying a MERN Application on Amazon EKS(LAB01)

Lachitha Senarathyapa - Jul 23 - - Dev Community

I am going to set up a CI/CD pipeline for MERN application development.

What is CI/CD?

CI/CD stands for Continuous Integration and Continuous Deployment (or Continuous Delivery). It is a set of practices and tools used to automate the processes of software integration, testing, and deployment. This helps in ensuring that software can be reliably released at any time.

Continuous integration (CI) refers to the practice of automatically and frequently integrating code changes into a shared source code repository.

Continuous delivery and/or deployment (CD) is a 2-part process that refers to the integration, testing, and delivery of code changes. Continuous delivery stops short of automatic production deployment, while continuous deployment automatically releases the updates into the production environment.

Architecture Diagram

This is the full architectural diagram for the CI/CD pipeline for the deployment of a Node application.

Image description

Explain the tools used for the pipeline.

· Jenkins: Automation server to orchestrate the CI/CD pipeline.

· GitHub: Version control system for managing the source code.

· Node.js: JavaScript runtime environment for executing code.

· SonarQube: Tool for continuous inspection of code quality.

· Aqua Trivy: Security scanner for vulnerabilities in filesystem and Docker images.

· Docker: Containerization platform for building and running applications.

· Amazon EKS: Managed Kubernetes service for deploying, managing, and scaling containerized applications.

We plan to set up the CI/CD pipeline in two phases: the entire pipeline.

  1. Completed up to docker deployment. (Deployment to development environment)

Image description

  1. Completed deployment on Elastic Kubernetes Service (Aws EKS).

Image description

Explain Pipeline Stages

· Git Checkout: Jenkins pulls the latest code from the GitHub repository.

· Node.js Environment Setup: Jenkins sets up the Node.js environment.

· Testing: Runs Node.js tests to ensure code functionality.

· Code Quality Check: SonarQube performs a code quality analysis.

· Filesystem Scan: Aqua Trivy scans the filesystem for vulnerabilities.

· Docker Build: Builds the Docker image for the Node.js application.

· Docker Image Scan: Aqua Trivy scans the Docker image for vulnerabilities.

· Push Docker Image: The Docker image is pushed to the Docker registry(Hub).

· Deploy to Local Environment: The Docker image is deployed to the Amazon EKS cluster.

· Deploy to Amazon EKS: The Docker image is deployed to the Amazon EKS cluster.

To be continued in Lab 02.

.