Skip to content

Atarook/library-mangment-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BM Project πŸ”₯

Here is A complete CI CD pipeline project supported with the required infrastructure for the AWS cloud

Demo Pipeline Video πŸŽ†

  • Here is the summary of our project, we supported our pipeline with a web hook from GitHub to Jenkins EC2 instance
ezyzip_aFf627CH.mp4

Demo Monitoring Video πŸš€

WhatsApp.Video.2024-09-12.at.7.09.04.PM.mp4

Tools used 🧰

jenkins flask sqlite terraform sonarqube aws docker kubernetes aws-cli nginx kubectl pip python linux bash prometheus grafana

Our Design

image

Let's explain our code

Jenkins-init ( Dir )

  • this directory is for IaC for Jenkins EC2 instance mainly, but it is also supported with

    • AWS CLI
    • SonarQube running on the instance
    • Nginx
    • Docker
    • Terraform
    • Kubectl
    • PiP3
  • All of that is installed automatically at the initialization of the EC2 instance (init.sh)

WhatsApp Image 2024-09-09 at 8 48 51 PM

  • Under that, we needed a strong t2.xlarge EC2 instance having high computing power with 100GB volume to support Jenkins builds

image

  • In the end, all the configurations done in Jenkins are one-time configurations (like installing plugins and setting credentials and pipelines), so we didn't count them as time-consuming jobs

Terraform ( Dir )

  • This directory is the IaC of our main infrastructure
  • We used S3 storage for storing the state of our IaC, πŸ˜† in fact, This helped us a lot.

image

  • The Hardest thing we faced here was the Volume Attachment, to apply volume attachment we needed to dive in the concepts of AWS EKS addons and how components communicate with each other , but how we solved this problem?

    • After Search we found that we need EBS CSI driver for the EKS to attach volumes

      image

    • Also we found that this EBS CSI driver needed IAM role with required policies to attach Volumes

      image

    • To attach the role successfully we needed OIDC, so we configured one

    image

    • and this is how we managed to attach volumes successfully

K8S ( Dir )

image

  • This Directory contains our important 4 files
    • pv.yaml >> for storage class ( πŸš€ yes, we applied dynamic provisioning, πŸͺ„ our volumes are created on demand)
    • pvc.yaml >> this is the claim, connection between deployment and volumes
    • deployment.yaml >> our dynamic pods, we typed this file in a specific way that helps as in the CD pipeline
    • service.yaml >> our πŸͺ¨ load balancer
  • Here we showed our Skills in working with Kubernetes.

Pipeline ( Dir )

  • Although this is a one-time task, we wanted to show our pipeline creation skills πŸ₯‡.

  • Jenkinsfile-infra-setup : Creates our pipeline WhatsApp Image 2024-09-11 at 11 18 54 PM

  • Jenkinsfile-Infra-destroy : Destroys our pipeline 😬

Dockerfile && .dockerignore

  • We created a simple DockerFile for containerizing our application and to publish it easily to the registry

image

  • We tried to minimize and optimize the size of the docker image as we can, so we used ".dockerignore" file

    image

Our Pipeline πŸ’˜

  • An optimized automated pipeline supported with lead approval

    WhatsApp Image 2024-09-12 at 2 10 08 AM

  • What does our pipeline do?

    • Checkout code from GitHub repo β˜‘οΈ

    • Apply Quality Assurance on it using SonarQube β˜‘οΈ

      WhatsApp Image 2024-09-12 at 2 00 44 AM

    • Build DockerFile and Push it to DockerHub 🐬

    • Change Deployment.yaml File according to the image name on the registry πŸ›³οΈ

    • Apply those changes to our EKS cluster on AWS 🌩️

    • Finished ♾️

  • How is our pipeline optimized? it deletes the image built from Jenkins EC2 to save resources. πŸͺ—

Monitoring

  • Disk Usage Monitoring πŸ’Ώ WhatsApp Image 2024-09-12 at 7 24 42 PM

  • Memory RAM monitoring πŸ“ WhatsApp Image 2024-09-12 at 7 24 42 PM (1)

  • CPU Utilization monitoring πŸ’» WhatsApp Image 2024-09-12 at 7 17 11 PM

  • I/O monitoring πŸ–±οΈ WhatsApp Image 2024-09-12 at 7 17 10 PM

  • Network traffic monitoring πŸ‘‹ WhatsApp Image 2024-09-12 at 7 17 10 PM (1)

Contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •