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

ComponentTypical platform team responsibility
Jenkins controllerInstallation, patching, backups, RBAC
Agents / build nodesCapacity, labels, toolchains, disk monitoring
CredentialsRegistry, SSH, kubeconfig, vault integration
Artifact registryContainer registry or Nexus/Artifactory access
Deploy targetsNetwork access, deploy users, rollback scripts
Pipeline standardsShared 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

ComponentRole
ControllerSchedules jobs, stores config, serves UI
AgentRuns pipeline steps on labeled build nodes
JenkinsfilePipeline-as-code in the repository
Shared libraryReusable deploy and notification steps
Credentials storeSecrets 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