How vishnuofficial164/devops-cicd-pipeline works
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 NodePort Service · namespace.yaml Namespace · deployment.yaml Deployment · Dockerfile Docker Build
Components 12
Source & CI
- GitHub · Pushes trigger the CI pipeline.
- Jenkins Pipeline · Builds, publishes, and deploys the image.
Jenkinsfile - Jenkins · Requires repository, registry, and cluster credentials.
Container Delivery
- Docker Build · Defines the image build context and runtime artifact.
Dockerfile - Docker Hub
Kubernetes Cluster
- Namespace · Must exist before namespaced resources are applied.
namespace.yaml - Deployment · Declares desired application state and image reference.
deployment.yaml - ReplicaSet & Pods · Generated and reconciled by the Deployment.
- NodePort Service · Selectors must match the Deployment Pod labels.
service.yaml - Kubernetes API · Receives manifest applies in the intended context.
External Access
- Browser Client
- Cluster Node Address
Connections 17
- 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