# vishnuofficial164/devops-cicd-pipeline architecture

> Architecture diagram of the GitHub repository vishnuofficial164/devops-cicd-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishnuofficial164/devops-cicd-pipeline
- Repository: https://github.com/vishnuofficial164/devops-cicd-pipeline

## Overview

#### Purpose and Scope
This repository is infrastructure for a minimal end-to-end CI/CD demonstration: source changes flow from GitHub through Jenkins, are packaged as a Docker image, published to Docker Hub, and deployed to Kubernetes. It contains deployment automation and manifests, not application source code.

#### CI/CD Entry Point
`Jenkinsfile` is the primary automation entry point. Jenkins is expected to trigger from GitHub changes, check out repository contents, build the application/image, push an image to Docker Hub, and apply or update Kubernetes resources. Jenkins therefore requires GitHub access, Docker build capability, Docker Hub credentials, and Kubernetes cluster credentials.

#### Container Build Boundary
`Dockerfile` defines the application container artifact consumed by deployment. It is the boundary between the build environment and runtime: Jenkins builds this image, Docker Hub stores it, and Kubernetes pulls it. The repository does not expose application source files, so the Dockerfile determines what build context and runtime process are available.

#### Kubernetes Workload Control Plane
`deployment.yaml` defines the Kubernetes Deployment, the desired application state, and its container image reference. Kubernetes creates and reconciles the underlying ReplicaSet and Pods; those generated resources are not separately defined in this repository. Image updates from the pipeline are deployed through this workload boundary.

#### Network Exposure
`service.yaml` defines the stable Kubernetes Service in front of the Deployment’s Pods. The documented access model is NodePort, allowing browser clients to reach the workload through a cluster node address and exposed port. Correct Service selectors must align with the Pod labels defined by `deployment.yaml`.

#### Namespace Isolation
`namespace.yaml` defines the Kubernetes namespace used to scope deployed resources. Deployment ordering must ensure this namespace exists before applying namespaced workload and Service manifests. The Jenkins deployment step is responsible for applying these manifests to the intended cluster/context.

#### Primary Flow and External Systems
Control flow is: GitHub push → Jenkins pipeline (`Jenkinsfile`) → Docker build (`Dockerfile`) → Docker Hub image registry → Kubernetes apply (`namespace.yaml`, `deployment.yaml`, `service.yaml`) → Deployment/ReplicaSet/Pods → NodePort Service → browser. Material external dependencies are GitHub, Jenkins, Docker/Docker Hub, and a Kubernetes cluster; Linux/Git support the execution environment.

Main entry points: [`service.yaml`](https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/service.yaml) (NodePort Service), [`namespace.yaml`](https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/namespace.yaml) (Namespace), [`deployment.yaml`](https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/deployment.yaml) (Deployment), [`Dockerfile`](https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/Dockerfile) (Docker Build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Source &amp; CI"]
  node_github{{"GitHub<br/>source host"}}
  node_jenkinsfile["Jenkins Pipeline<br/>pipeline definition"]
  node_jenkins["Jenkins<br/>CI runner"]
end

subgraph group_container["Container Delivery"]
  node_dockerfile["Docker Build<br/>container recipe"]
  node_dockerhub[("Docker Hub<br/>image registry")]
end

subgraph group_cluster["Kubernetes Cluster"]
  node_namespace["Namespace<br/>[namespace.yaml]"]
  node_deployment["Deployment<br/>workload manifest<br/>[deployment.yaml]"]
  node_workload["ReplicaSet &amp; Pods<br/>managed workload"]
  node_service["NodePort Service<br/>service manifest<br/>[service.yaml]"]
  node_kubernetes{{"Kubernetes API<br/>cluster control plane"}}
end

subgraph group_access["External Access"]
  node_browser(("Browser Client"))
  node_cluster_node["Cluster Node Address<br/>NodePort endpoint"]
end

node_github -->|"push trigger"| node_jenkins
node_jenkinsfile -->|"defines stages"| node_jenkins
node_jenkins -->|"checks out"| node_github
node_jenkins -->|"builds from"| node_dockerfile
node_dockerfile -->|"image artifact"| node_dockerhub
node_jenkins -->|"pushes image"| node_dockerhub
node_jenkins -->|"applies manifests"| node_kubernetes
node_kubernetes -->|"creates first"| node_namespace
node_kubernetes -->|"applies"| node_deployment
node_kubernetes -->|"applies"| node_service
node_dockerhub -->|"image pull"| node_workload
node_deployment -->|"reconciles"| node_workload
node_namespace -->|"scopes"| node_deployment
node_namespace -->|"scopes"| node_service
node_service -->|"selects Pods"| node_workload
node_browser -->|"connects to"| node_cluster_node
node_cluster_node -->|"NodePort routes"| node_service

click node_jenkinsfile "https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/Jenkinsfile"
click node_dockerfile "https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/Dockerfile"
click node_namespace "https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/namespace.yaml"
click node_deployment "https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/deployment.yaml"
click node_service "https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/service.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_github,node_jenkinsfile,node_jenkins toneBlue
class node_dockerfile,node_dockerhub toneAmber
class node_namespace,node_deployment,node_workload,node_service,node_kubernetes toneMint
class node_browser,node_cluster_node toneRose
```

## Components

### Source & CI

- **GitHub**: source host · Pushes trigger the CI pipeline.
- [Jenkins Pipeline](https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/Jenkinsfile): pipeline definition · Builds, publishes, and deploys the image. · `Jenkinsfile`
- **Jenkins**: CI runner · Requires repository, registry, and cluster credentials.

### Container Delivery

- [Docker Build](https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/Dockerfile): container recipe · Defines the image build context and runtime artifact. · `Dockerfile`
- **Docker Hub**: image registry

### Kubernetes Cluster

- [Namespace](https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/namespace.yaml): namespace manifest · Must exist before namespaced resources are applied. · `namespace.yaml`
- [Deployment](https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/deployment.yaml): workload manifest · Declares desired application state and image reference. · `deployment.yaml`
- **ReplicaSet & Pods**: managed workload · Generated and reconciled by the Deployment.
- [NodePort Service](https://github.com/vishnuofficial164/devops-cicd-pipeline/blob/Master/service.yaml): service manifest · Selectors must match the Deployment Pod labels. · `service.yaml`
- **Kubernetes API**: cluster control plane · Receives manifest applies in the intended context.

### External Access

- **Browser Client**: client
- **Cluster Node Address**: NodePort endpoint

## Connections

- GitHub → Jenkins: push trigger
- Jenkins Pipeline → Jenkins: defines stages
- Jenkins → GitHub: checks out
- Jenkins → Docker Build: builds from
- Docker Build → Docker Hub: image artifact
- Jenkins → Docker Hub: pushes image
- Jenkins → Kubernetes API: applies manifests
- Kubernetes API → Namespace: creates first
- Kubernetes API → Deployment: applies
- Kubernetes API → NodePort Service: applies
- Docker Hub → ReplicaSet & Pods: image pull
- Deployment → ReplicaSet & Pods: reconciles
- Namespace → Deployment: scopes
- Namespace → NodePort Service: scopes
- NodePort Service → ReplicaSet & Pods: selects Pods
- Browser Client → Cluster Node Address: connects to
- Cluster Node Address → NodePort Service: NodePort routes
