# samsorrahman/end-to-end-devops-project architecture

> Architecture diagram of the GitHub repository samsorrahman/end-to-end-devops-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/samsorrahman/end-to-end-devops-project
- Repository: https://github.com/samsorrahman/end-to-end-devops-project

## Overview

##### Project Type and Purpose
- This is a full-stack DevOps pipeline project combining:
- Infrastructure as Code (Terraform)
- Continuous Integration (Jenkins)
- GitOps Continuous Deployment (ArgoCD)
- Container orchestration (Kubernetes on AWS EKS)
- Persistent storage (EFS for database)
- Load balancing & TLS (AWS ALB + ACM + Route 53)
- Monitoring & alerting (Prometheus, Grafana, AlertManager)

##### File Structure
- Top-level directories represent major architecture layers:
- Terraform/: provisions AWS resources (VPC, EKS, ECR, EC2, EFS, Route 53, ACM)
- Jenkins_cicd/: contains Django app, Dockerfile, Jenkinsfile for CI
- Kubernetes with ArgoCD/: GitOps manifests (Deployments, StatefulSets, Ingress, Service, ConfigMap, Secrets)
- Install and Configuration/: procedural docs for manual setup and monitoring
- Configuration files indicate use of modules/patterns: VPC module, EKS module, IAM roles, backend S3 bucket, ArgoCD manifests.

##### README for Additional Insights
- Key workflows and AWS services are explicitly called out, with details on namespace separation (argocd, monitoring).

a. Version Control & CI Layer
- GitHub App Repository
- Jenkins CI server (EC2 instance)
- Amazon ECR registry
b. GitOps & CD Layer
- GitOps repository (holds Kubernetes YAML under “Kubernetes with ArgoCD/”)
- ArgoCD server (in argocd namespace)
c. Kubernetes Cluster (AWS EKS)
- App Deployment (Django Pods, Service)
- DB StatefulSet (MySQL Pods)
- Persistent Volumes backed by Amazon EFS
- Ingress Controller (AWS ALB Ingress)
- ConfigMaps / Secrets / RBAC
d. Networking & Security
- Amazon VPC with public/private subnets
- Route 53 hosted zone (DNS)
- AWS Certificate Manager (ACM) SSL certificates
- Security Groups / IAM Roles
e. Monitoring & Alerting
- Prometheus server (monitoring namespace)
- Alertmanager (email alerting)
- Grafana dashboards (visualization)

- GitHub → (webhook) → Jenkins CI → build Docker image → push to ECR
- Jenkins CI → update GitOps repo → ArgoCD
- ArgoCD → sync → EKS API → create/update Deployments & StatefulSets
- EKS Pods → mount EFS for persistence
- Client traffic → Route 53 → ALB Ingress → Kubernetes Ingress Controller → App Service → App Pods
- Prometheus → scrape metrics from kube-api, pods, cAdvisor → Alertmanager → email
- Grafana → query Prometheus → render dashboards

##### Architectural Patterns & Principles
- IaC modularization (Terraform modules for VPC, EKS, EFS, IAM)
- GitOps (ArgoCD watches declarative manifests)
- CI/CD separation (Jenkins vs ArgoCD)
- Immutable artifacts (Docker images in ECR)
- Namespace isolation (argocd, monitoring, default)
- RBAC for cluster and application security

##### Critical Technologies & Tools
- Terraform (HCL modules, S3 backend + DynamoDB lock)
- AWS Services (EKS, EC2, ECR, EFS, ALB, ACM, Route 53, S3, IAM)
- Jenkins (Dockerfile, Jenkinsfile, plugin credentials)
- Docker (containerization)
- ArgoCD (GitOps CD)
- Kubernetes (Deployments, StatefulSets, ConfigMaps, Secrets, Ingress)
- Prometheus & Alertmanager, Grafana

##### Detail
- Don’t omit the S3 backend and DynamoDB lock for Terraform state
- ECR registry as the artifact store
- EC2 instance running Jenkins and its security group
- MySQL StatefulSet pods mounting EFS via PersistentVolumeClaims
- Prometheus targets (kube-API, node exporters, app endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Develop & CI Layer
    subgraph "Develop & CI" 
        direction TB
        GH["GitHub App Repository"]:::external
        Jenkins["Jenkins CI Server (EC2)"]:::cicd
        ECR["Amazon ECR Registry"]:::aws
    end

    GH -->|"webhook"| Jenkins
    Jenkins -->|"build & push image"| ECR

    click Jenkins "https://github.com/samsorrahman/end-to-end-devops-project/tree/main/Jenkins_cicd/Dockerfile"
    click Jenkins "https://github.com/samsorrahman/end-to-end-devops-project/tree/main/Jenkins_cicd/Jenkinsfile"
    click ECR "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Terraform/ecr/ecr.tf"

    %% CD & GitOps Layer
    subgraph "CD & GitOps"
        direction TB
        GitOpsRepo["GitOps Repository\n(Kubernetes with ArgoCD)"]:::cicd
        ArgoCD["ArgoCD Server"]:::cicd
    end

    Jenkins -->|"update manifests"| GitOpsRepo
    GitOpsRepo -->|"GitOps sync"| ArgoCD
    click GitOpsRepo "https://github.com/samsorrahman/end-to-end-devops-project/tree/main/Kubernetes with ArgoCD/"

    %% Infra & Kubernetes Layer
    subgraph "Infrastructure Provisioning (Terraform)" 
        direction TB
        TFMain["Terraform Main & Provider"]:::aws
        VPCMod["Terraform VPC Module"]:::aws
        EKSMod["Terraform EKS Module"]:::aws
        EC2Mod["Terraform EC2 & Jenkins Server"]:::aws
        EFSMod["Terraform EFS Provisioning"]:::aws
        R53ACM["Terraform Route53 & ACM"]:::aws
    end

    TFMain --> VPCMod
    TFMain --> EKSMod
    TFMain --> EC2Mod
    TFMain --> EFSMod
    TFMain --> R53ACM

    click TFMain "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Terraform/main.tf"
    click TFMain "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Terraform/provider.tf"
    click VPCMod "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Terraform/vpc/vpc_main.tf"
    click EKSMod "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Terraform/eks/eks.tf"
    click EC2Mod "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Terraform/ec2/ec2.tf"
    click EC2Mod "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Terraform/ec2/iam_role.tf"
    click EFSMod "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Terraform/efs/efs.tf"
    click R53ACM "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Terraform/Route53_ACM/route53_acm.tf"

    subgraph "Kubernetes Cluster (EKS)" 
        direction TB
        AppDeploy["Django App Deployment"]:::k8s
        AppService["App Service"]:::k8s
        DBStateful["MySQL DB StatefulSet"]:::k8s
        PV["Persistent Volume (EFS)"]:::k8s
        IngressCtrl["Ingress Controller"]:::k8s
        Config["ConfigMaps & Secrets"]:::k8s
    end

    ArgoCD -->|"kubectl apply"| AppDeploy
    ArgoCD --> AppService
    ArgoCD --> DBStateful
    AppDeploy --> PV
    AppDeploy --> Config
    DBStateful --> PV
    AppDeploy --> AppService
    AppService --> IngressCtrl

    %% Networking & Security Layer
    subgraph "Networking & Security"
        direction TB
        Route53["Route 53 Hosted Zone"]:::aws
        ALB["AWS ALB Ingress + TLS"]:::aws
        ACM["ACM SSL Certificates"]:::aws
        IAM["IAM Roles & Security Groups"]:::security
    end

    Route53 -->|"DNS"| ALB
    ALB --> IngressCtrl
    ALB --> ACM
    EC2Mod --> IAM
    EKSMod --> IAM
    EFSMod --> IAM
    VPCMod --> IAM

    %% Monitoring Layer
    subgraph "Monitoring & Alerting"
        direction TB
        Prom["Prometheus Server"]:::monitoring
        AM["Alertmanager"]:::monitoring
        Grafana["Grafana Dashboards"]:::monitoring
    end

    Prom -->|"alert rules"| AM
    Grafana -->|"queries Prometheus"| Prom
    AppDeploy -->|"scrape metrics"| Prom
    DBStateful -->|"scrape metrics"| Prom
    IngressCtrl -->|"scrape metrics"| Prom

    click Prom "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Install and Configuration/Prometheus installation.txt"
    click Prom "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Install and Configuration/prometheus yml file.txt"
    click AM "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Install and Configuration/Alert Rules.txt"
    click AM "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Install and Configuration/Email Alert.txt"
    click Grafana "https://github.com/samsorrahman/end-to-end-devops-project/blob/main/Install and Configuration/Grafana installation.txt"

    %% Styles
    classDef aws fill:#cce5ff,stroke:#005cbf,color:#005cbf;
    classDef k8s fill:#d4edda,stroke:#155724,color:#155724;
    classDef cicd fill:#fff3cd,stroke:#856404,color:#856404;
    classDef monitoring fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
    classDef security fill:#f8d7da,stroke:#721c24,color:#721c24;
    classDef external fill:#f0f0f0,stroke:#888888,color:#888888;
```
