# bhasker-manikyala/purdue_b35 architecture

> Architecture diagram of the GitHub repository bhasker-manikyala/purdue_b35, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhasker-manikyala/purdue_b35
- Repository: https://github.com/bhasker-manikyala/purdue_b35

## Overview

##### Project type and purpose
- This repository is a DevOps “playground” monorepo, containing infrastructure-as-code, CI/CD pipelines, container definitions, orchestration manifests, monitoring recipes, and assorted scripts for learning and demonstration. It is not a single application but a collection of modules covering Ansible, Terraform hints, Docker, Kubernetes, Jenkins, Git, Puppet, Nagios, Splunk, cloud (AWS/GCP) setup, and more.

##### Key components
a. Version Control (Git)
– git directory with samples, install scripts, server config.
b. CI/CD (Jenkins)
– Jenkins master, build agents, Pipeline-as-Code (Jenkinsfiles), Artifactory/JFrog.
c. Configuration Management
– Ansible control node, inventories/playbooks/roles, Puppet master/agent examples.
d. Containerization
– Docker daemon, Dockerfiles under docker/images, Docker Compose services, Swarm stacks.
e. Orchestration
– Kubernetes cluster (master, worker nodes), manifests (deployments, services, ingress, HPA), dashboard.
f. Infrastructure (Cloud)
– AWS & GCP provisioning scripts, EC2 instance setup, Terraform pointers.
g. Monitoring & Logging
– Nagios Core/xi containers, Splunk forwarders & search.
h. Sample Applications
– Java/Tomcat, Spring Boot/Mongo, Nginx/Apache, WordPress, sample WAR/JARs.

##### Relationships & interactions
- Developer commits code to Git → webhook triggers Jenkins pipeline → Jenkins checks out repo → builds artifacts (JAR/WAR) → builds Docker images → pushes to registry → deploys to Docker Compose or Swarm or publishes Helm charts for Kubernetes cluster.
- Ansible/Puppet orchestrates configuration of VMs or nodes on cloud providers, installs Docker, Kubernetes prerequisites, SSH keys.
- Kubernetes ingress/load-balancer routes external traffic to services; HPA scales pods.
- Nagios monitors health of nodes/containers; Splunk collects logs from apps and infra.

##### Architectural patterns and principles
– Immutable infrastructure: pipelines build fresh images.
– Infrastructure as Code: all configuration in YAML/Playbooks/Manifests.
– GitOps flavour: manifests versioned in Git.
– Modular roles/playbooks in Ansible; layered Dockerfiles.
– Microservice abstraction in K8s (Deployments + Services + Ingress).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Swimlanes
    subgraph "Developers & Version Control"
        direction TB
        Dev["Developer"]:::external
        GitRepo["Git Repository"]:::cfgMgmt
    end

    subgraph "CI/CD Layer"
        direction TB
        JenkinsMaster["Jenkins Master"]:::ci
        BuildAgents["Jenkins Build Agents"]:::ci
        Jenkinsfile["Pipeline-as-Code (Jenkinsfile)"]:::ci
        JFrog["Artifactory/JFrog"]:::ci
    end

    subgraph "Configuration Management" 
        direction TB
        AnsibleNode["Ansible Control Node"]:::cfgMgmt
        AnsiblePlaybooks["Ansible Playbooks & Inventories"]:::cfgMgmt
        RolesDocker["Ansible Role: Docker"]:::cfgMgmt
        RolesTomcat["Ansible Role: Tomcat"]:::cfgMgmt
        PuppetMaster["Puppet Master/Agent"]:::cfgMgmt
    end

    subgraph "Infrastructure Provisioning"
        direction TB
        AWS["AWS Cloud"]:::infra
        GCP["GCP Cloud"]:::infra
        Terraform["Terraform Pointers"]:::infra
    end

    subgraph "Runtime Containerization"
        direction TB
        DockerEngine["Docker Daemon"]:::container
        DockerImages["Docker Images"]:::container
        ComposeSvcs["Docker Compose Services"]:::container
        SwarmStacks["Docker Swarm Stacks"]:::container
    end

    subgraph "Runtime Orchestration"
        direction TB
        K8sMaster["Kubernetes Master (API Server, etcd)"]:::orchestration
        K8sWorkers["Kubernetes Worker Nodes"]:::orchestration
        Ingress["Kubernetes Ingress"]:::orchestration
        Metrics["Metrics Server (HPA)"]:::orchestration
        Dashboard["Kubernetes Dashboard"]:::orchestration
    end

    subgraph "Monitoring & Logging"
        direction TB
        NagiosCore["Nagios Core"]:::mon
        NagiosXI["Nagios XI"]:::mon
        Splunk["Splunk Forwarder"]:::mon
    end

    %% Connections
    Dev -->|commits code| GitRepo
    GitRepo -->|git webhook| JenkinsMaster
    JenkinsMaster -->|checkout code| GitRepo
    JenkinsMaster -->|execute| Jenkinsfile
    JenkinsMaster -->|trigger builds| BuildAgents
    BuildAgents -->|build Docker images| DockerImages
    JenkinsMaster -->|push images| JFrog
    JenkinsMaster -->|deploy to Compose| ComposeSvcs
    JenkinsMaster -->|deploy to Swarm| SwarmStacks
    JenkinsMaster -->|publish Helm charts| K8sMaster

    AnsibleNode -.->|ssh/Ansible| AWS
    AnsibleNode -.->|ssh/Ansible| GCP
    AnsibleNode -.->|configure| DockerEngine
    AnsibleNode -.->|configure| K8sMaster

    PuppetMaster -.->|puppet apply| AWS
    PuppetMaster -.->|puppet apply| GCP

    AWS -->|provision VMs| DockerEngine
    GCP -->|provision VMs| DockerEngine
    AWS -->|provision Kubernetes| K8sMaster
    GCP -->|provision Kubernetes| K8sMaster

    DockerImages -->|run containers| DockerEngine
    ComposeSvcs -->|run services| DockerEngine
    SwarmStacks -->|deploy stacks| DockerEngine

    K8sMaster -->|schedule pods| K8sWorkers
    K8sWorkers -->|serve traffic| Ingress
    Metrics -->|autoscale| K8sWorkers
    Ingress -->|route traffic| K8sWorkers

    NagiosCore <-->|monitor health| AWS
    NagiosCore <-->|monitor health| DockerEngine
    Splunk <-->|collect logs| DockerEngine
    Splunk <-->|collect logs| K8sMaster

    %% Click Events
    click GitRepo "https://github.com/bhasker-manikyala/purdue_b35/tree/main/git/"
    click JenkinsMaster "https://github.com/bhasker-manikyala/purdue_b35/tree/main/jenkins/"
    click Jenkinsfile "https://github.com/bhasker-manikyala/purdue_b35/tree/main/jenkins/Pipeline-As-Code/Jenkinsfile"
    click JFrog "https://github.com/bhasker-manikyala/purdue_b35/blob/main/jenkins/Jfrog/JfrogSetup.txt"
    click AnsibleNode "https://github.com/bhasker-manikyala/purdue_b35/tree/main/ansible/"
    click AnsiblePlaybooks "https://github.com/bhasker-manikyala/purdue_b35/tree/main/ansible/playbooks/"
    click RolesDocker "https://github.com/bhasker-manikyala/purdue_b35/tree/main/ansible/roles/docker/"
    click RolesTomcat "https://github.com/bhasker-manikyala/purdue_b35/tree/main/ansible/roles/tomcat/"
    click PuppetMaster "https://github.com/bhasker-manikyala/purdue_b35/tree/main/puppet/"
    click DockerEngine "https://github.com/bhasker-manikyala/purdue_b35/blob/main/docker/install/installDocker.sh"
    click DockerImages "https://github.com/bhasker-manikyala/purdue_b35/tree/main/docker/images/"
    click ComposeSvcs "https://github.com/bhasker-manikyala/purdue_b35/tree/main/docker/compose/"
    click SwarmStacks "https://github.com/bhasker-manikyala/purdue_b35/tree/main/docker/swarm/"
    click K8sMaster "https://github.com/bhasker-manikyala/purdue_b35/tree/main/kube/install/"
    click Ingress "https://github.com/bhasker-manikyala/purdue_b35/tree/main/kube/ingress/"
    click Dashboard "https://github.com/bhasker-manikyala/purdue_b35/tree/main/kube/dashboard/"
    click AWS "https://github.com/bhasker-manikyala/purdue_b35/tree/main/cloud/aws/"
    click GCP "https://github.com/bhasker-manikyala/purdue_b35/tree/main/cloud/gcp/"
    click Terraform "https://github.com/bhasker-manikyala/purdue_b35/blob/main/Terraform Final Project.txt"
    click NagiosCore "https://github.com/bhasker-manikyala/purdue_b35/tree/main/nagios/core/Dockerfile"
    click NagiosXI "https://github.com/bhasker-manikyala/purdue_b35/blob/main/nagios/xi/nagios.yml"
    click Splunk "https://github.com/bhasker-manikyala/purdue_b35/blob/main/splunk/configureForwarding.txt"

    %% Styles
    classDef external fill:#ffffff,stroke:#000;
    classDef ci fill:#a8cef1,stroke:#000;
    classDef container fill:#c8e6c9,stroke:#000;
    classDef orchestration fill:#ffcc80,stroke:#000;
    classDef cfgMgmt fill:#e1bee7,stroke:#000;
    classDef infra fill:#eeeeee,stroke:#000;
    classDef mon fill:#fff59d,stroke:#000;
```
