Skip to content

My Devops project (from scratch): CICD with Gitlab-CI, Jenkins, Docker and also running on Kubernetes cluster

Notifications You must be signed in to change notification settings

DatNguyen2711/Devops-Pipeline-On-Premise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tech Stack

This project utilizes the following technologies:

Technology Description
.NET Core API 8 .NET Core API 8 Backend
ReactJS ReactJS Frontend
SQL Server SQL Server Database
Docker Docker Containerization
AWS EC2 AWS EC2 Cloud infrastructure (server for Harbor)
Harbor Registry Harbor Registry Container registry
Gitlab-CI Gitlab-CI Continuous Integration
Jenkins Jenkins Continuous Integration
Ubuntu Ubuntu Operating System
Kubernetes Kubernetes Container orchestration
Terraform Terraform Infrastructure as Code (IaC)
Groovy Groovy Scripting (Jenkins pipeline script)
Helm Helm Kubernetes package management
VMWare VMWare Virtualization (100% infra using this)
Argo CD ArgoCD Gitops
Kaniko Kaniko Build container images in Kubernetes without Docker daemon
Vault HashiCorp Vault Secret management
OpenTelemetry OpenTelemetry Observability and Monitoring
Prometheus Prometheus Metrics collection and monitoring
Grafana Grafana Data visualization and monitoring

Getting Started

First, run the development server:

docker compose up -d

Open http://localhost:8900 with your browser to see the result.

You can start editing the page by modifying Medicine-Web-FE/src/component/auth/login. The page auto-updates as you edit the file.

This project uses next/font to write API and also ReactJS for client

Learn More

Deploy on EC2 Instance

The easiest way to deploy this app is to use the AWS EC2 AWS Platform

Step 1: Register a EC2 (T2 medium above because SQL server need 2000MB to run) instance using Ubuntu ( Remember you open Inbound Rules of Instance before run the application AWS Platform )

Step 2: Download Docker (lastest version is best)

mkdir -p /tools/docker

touch docker-install.sh && chmod +x docker-install.sh && vi docker-install.sh

#!/bin/bash
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update -y
sudo apt install docker-ce -y
sudo systemctl start docker
sudo systemctl enable docker
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker -v
docker-compose -v


./docker-install.sh


sudo usermod -aG docker $(whoami)

Step 3 : Clone this Repo and cd path/to/the repo

docker compose up -d

Step 4: Go to the address:

http://{instance_public_IP_address}:8900

More

You can using certbot and buy an domain

Create EC2 Instance with Terraform

image

Step 1: First, run you have to create AWS account and IAM user account

Open IAM AWS docs to see how to create AWS account and IAM user

Step 2: Attach to IAM user policies such as : AdministratorAccess (you can using only Administrator ec2 policies)

Click to the user then select security credentials and then follow the instructions to create access key for IAM user (follow to the bellow instructions) image then... image image then name your tag, here is your access key image

Step 3: Configure aws key in your local machine

aws configure


----
AWS Access Key ID [****************PAWK]: ************
AWS Secret Access Key [****************tz1d]: ***************

Step 4: Run this command to create and running EC2 Instance

terraform init

terraform plan

terraform apply --auto-approve