Jenkins CI/CD
Jenkins is one of the most widely deployed CI/CD platforms in enterprise environments. It connects Git commits to automated builds, tests, artifact publishing, and staged production deployments.
Part of my Infrastructure learning notes.
What infrastructure engineers own
| Component | Typical platform team responsibility |
|---|---|
| Jenkins controller | Installation, patching, backups, RBAC |
| Agents / build nodes | Capacity, labels, toolchains, disk monitoring |
| Credentials | Registry, SSH, kubeconfig, vault integration |
| Artifact registry | Container registry or Nexus/Artifactory access |
| Deploy targets | Network access, deploy users, rollback scripts |
| Pipeline standards | Shared libraries, approval gates, security scanning |
Developers own application code and tests; platform teams make the pipeline reliable and safe.
End-to-end flow
git push → webhook → Jenkins controller → agent
→ checkout → test → build → scan → push artifact
→ deploy DEV → deploy staging → approve → deploy production
Core architecture
| Component | Role |
|---|---|
| Controller | Schedules jobs, stores config, serves UI |
| Agent | Runs pipeline steps on labeled build nodes |
| Jenkinsfile | Pipeline-as-code in the repository |
| Shared library | Reusable deploy and notification steps |
| Credentials store | Secrets referenced by ID, never in Git |
Common agent patterns
- Permanent Linux VMs — stable toolchain for legacy builds
- Docker agents — clean environment per build
- Kubernetes agents — elastic scale for container-native teams
- SSH agents — remote hosts already in the estate
How Jenkins connects to the stack
- Ansible — configuration and deploy playbooks triggered from pipeline stages
- Docker & Kubernetes — image build, registry push, and cluster rollout
- Git — source control webhooks and Jenkinsfile versioning
Common issues (quick reference)
- Webhook not firing — firewall, wrong URL, branch filters
- Agent offline — label mismatch, SSH failure, full disk
- Deploy permission denied — expired credentials or blocked agent IP
- False-green deploy — shallow health checks, missing migrations
- Plugin upgrade breaks pipelines — test on staging controller first
Full pipeline guide
The detailed walkthrough — including a complete Jenkinsfile, Ansible and Kubernetes deploy examples, security checklist, and expanded troubleshooting — is in the blog post:
Jenkins CI/CD: From Developer Push to Production Deployment