Skip to main content
Cloud DevOps Solutions
Get a quote Talk to an engineer

CI/CD and GitOps

Jenkins Consulting: Run It Safely or Move Off It Cleanly

Jenkins is an open source automation server used to build, test and deploy software through jobs and pipelines defined in a Jenkinsfile. We stabilise existing Jenkins estates with pipeline as code, ephemeral agents, plugin hygiene and hardened access, and we plan clean migrations to other CI systems when Jenkins no longer fits.

Key takeaways

  • Jenkins remains a capable and flexible automation server, but its freedom is also its risk: unmanaged plugins and snowflake jobs are the usual cause of pain.
  • Treat Jenkins itself as code: configuration as code, pinned plugins and a rebuildable controller.
  • Run builds on ephemeral agents, such as Kubernetes pods, and keep the controller free of build workloads.
  • Security hygiene is non-negotiable: current core and plugins, least-privilege roles, no secrets in job configuration.
  • Migrating away is a project, not a switch. Move pipeline by pipeline and run old and new side by side.

What teams use Jenkins for

Stabilising a legacy Jenkins estate

Dozens of hand-edited freestyle jobs are inventoried, converted to Jenkinsfiles and brought under version control.

Kubernetes-based build agents

Each build runs in a fresh pod with the exact tools it needs, so agents stop drifting and capacity follows demand.

Regulated or air-gapped delivery

Environments that cannot use hosted CI keep full control of build infrastructure, networks and artefact storage.

Shared libraries for many teams

Common build, scan and release steps are published once and called from every Jenkinsfile.

Planned migration to a modern CI platform

Pipelines are rewritten for GitHub Actions or GitLab CI in phases, with parallel runs to prove equivalence.

What Jenkins is and why it is still everywhere

Jenkins is an open source automation server, written in Java and extended through plugins. It schedules jobs, runs them on agents, and reports results. Since pipelines can be written in a Jenkinsfile, it can express almost any build and release process. That flexibility, together with years of accumulated plugins, is why so many organisations still run it.

It is also why Jenkins estates become fragile. A controller edited through the web interface, a long list of plugins nobody has reviewed, agents with hand-installed tools, and credentials scattered across job configurations. Our Jenkins consulting work focuses on turning that into something rebuildable and secure, and on being honest about when the right answer is to leave.

How we run Jenkins in production

Controller as code

The controller should be reproducible. We define configuration with the Configuration as Code plugin, pin plugin versions in a manifest, build the controller image from that, and store it all in git. A rebuilt controller then comes up with the same security realm, roles, clouds and global settings, and a plugin upgrade is a reviewed change tested in staging first.

Ephemeral agents on Kubernetes

The controller schedules; it does not build. Builds run on agents, and the cleanest model is a fresh pod per build with the tools that job needs.

pipeline {
  agent {
    kubernetes {
      yaml '''
        apiVersion: v1
        kind: Pod
        spec:
          containers:
            - name: build
              image: registry.example.com/ci/node-build:22
              command: ["sleep"]
              args: ["infinity"]
              resources:
                requests: { cpu: "500m", memory: "1Gi" }
                limits:   { memory: "2Gi" }
      '''
    }
  }
  options { timeout(time: 30, unit: 'MINUTES') }
  stages {
    stage('Test') {
      steps { container('build') { sh 'npm ci && npm test' } }
    }
  }
}

Build images are versioned and scanned like any other image. Timeouts stop stuck jobs from holding capacity. If you do not yet run a cluster for this, our Kubernetes consulting team can size a build pool, or we can use autoscaled cloud instances instead.

Shared libraries

Repeated steps such as build, scan, publish and deploy belong in a shared library, versioned by tag. Application Jenkinsfiles then shrink to a few lines. This is the Jenkins equivalent of the patterns in reusable workflows and pipeline as code.

Pipelines that fail fast and recover cleanly

A Jenkinsfile should do the cheap checks first, set timeouts on every stage, archive only the artefacts you need and clean its workspace. We add retry only around genuinely flaky external calls, never around tests, because retrying tests hides instability. Post-build handlers send notifications and always release locks or cloud resources. These small habits keep agents available, and keep failures visible rather than silently masked, which matters more on a shared controller than any single plugin choice.

Security and access

Jenkins has a long public record of plugin vulnerabilities, so patch discipline matters more here than on a hosted platform.

  • Keep core and plugins current, and remove plugins you do not use.
  • Use your identity provider for authentication and role-based or matrix authorisation instead of shared accounts.
  • Run zero executors on the controller so build code cannot touch it.
  • Keep secrets in the credentials store or an external manager, never in job parameters or scripts. See CI/CD secrets management with Vault.
  • Treat the script approval queue as a security control. Approve narrowly and review what is approved.
  • Do not expose the controller to the public internet. Put it behind a VPN or an authenticating proxy.

Cost and capacity

Jenkins itself is free, but the real costs are people and infrastructure. Idle long-lived agents are the usual waste. Ephemeral agents that scale to zero convert that into pay-per-build. The hidden cost is maintenance time: upgrades, plugin compatibility and the engineer who understands the oldest jobs. When we compare Jenkins with hosted CI for a client, we count that time, because it often outweighs infrastructure savings.

Day-2 operations

  • Backups: back up the controller home or, better, rely on configuration as code plus a backup of build history you actually need. Test a restore.
  • Upgrades: monthly in staging, then production, with a rollback image ready.
  • Monitoring: expose metrics and watch queue length, agent provisioning time and failure rates through Prometheus and Grafana.
  • Hygiene: discard old builds, delete unused jobs and rotate credentials on a schedule.

Failure modes we see most

SymptomLikely causeOur approach
Controller slow or crashingBuilds on the controller, huge historyZero executors, retention limits
Upgrade breaks jobsUnpinned or abandoned pluginsStaging clone, pinned manifest
Builds differ between agentsHand-installed toolsContainer-based agents
Credential leakSecrets in job config or logsCredentials store, masking, rotation
Nobody knows what a job doesFreestyle jobs configured in the UIJenkinsfiles in git

When to move off Jenkins

Leave if you spend more effort keeping Jenkins alive than shipping software, if your team cannot staff its upkeep, or if your code already lives on a platform with built-in CI. GitHub Actions and GitLab CI/CD are the common destinations, and Azure Pipelines fits Azure DevOps users. Stay if you need full control in an isolated network or have deeply customised workflows that would be costly to rewrite.

Our approach to moving is in the Jenkins to Actions migration plan and the migration guide on our blog. Start with a conversation through our CI/CD pipeline service or contact us.

Official documentation: www.jenkins.io/doc

How we work with Jenkins

  1. 01

    Inventory jobs, plugins and access

    We list every job, who uses it, which plugins it needs, what credentials it holds and how long it takes. Dead jobs are retired first.

  2. 02

    Stabilise the controller

    We upgrade core and plugins in a staging copy, enable configuration as code, set up backups and move builds off the controller.

  3. 03

    Move builds to ephemeral agents

    Agents become pods or short-lived instances built from versioned images, with resource limits and no long-lived state.

  4. 04

    Convert to pipeline as code

    Freestyle jobs become Jenkinsfiles in the application repositories, using shared libraries for repeated logic.

  5. 05

    Harden security and secrets

    Roles, authentication, credentials storage and script approval are tightened, and secrets move to a proper secrets manager.

  6. 06

    Decide: keep, improve or migrate

    With data on cost and effort, we agree whether to remain on Jenkins or phase pipelines onto another platform.

Jenkins compared with the alternatives

We recommend the tool that fits your team, not the one we know best. Here is when each option makes sense.

OptionChoose it when
JenkinsJenkins is an open source automation server used to build, test and deploy software through jobs and pipelines defined in a Jenkinsfile.
GitHub ActionsChoose it if your code is on GitHub and you want no CI server to maintain. This is the most common destination for teams leaving Jenkins.
GitLab CI/CDChoose it if you use GitLab, or want repositories, registry, scanning and pipelines in one platform.
Azure PipelinesChoose it if you already use Azure DevOps boards and repositories and want hosted or self-hosted agents with managed governance.
Tekton or Argo WorkflowsChoose them if you want pipelines defined as Kubernetes resources and are comfortable operating that model.

Tools we use alongside Jenkins

Jenkins Configuration as CodeKubernetes pluginJenkins Shared LibrariesBlue Ocean alternativesDockerHelmSonarQubeTrivyHashiCorp VaultNexusArtifactoryPrometheus

Frequently asked questions

Is Jenkins still worth using?
Yes, in the right setting. Jenkins is mature, free and extremely flexible, which suits on-premises, air-gapped or heavily customised delivery. It costs more to operate than hosted CI, because you own upgrades, security and capacity. If you lack the people to run it well, a hosted platform is usually cheaper overall.
How do we secure Jenkins?
Keep core and plugins current, remove unused plugins, require authentication with role-based access, disable builds on the controller, store credentials in the credentials store or an external secrets manager, restrict script approval, and keep the controller off the public internet. Back up configuration and test restoring it.
What is a Jenkinsfile?
A Jenkinsfile is a text file in your repository that defines a Jenkins pipeline as code, either in declarative or scripted syntax. Keeping it with the application means pipeline changes are reviewed, versioned and tied to the code they build, unlike jobs configured by hand in the web interface.
Should Jenkins agents run on Kubernetes?
Often yes. With the Kubernetes plugin each build starts a pod defined by a template, then discards it. That removes agent drift and scales with demand. You need cluster capacity, image management and care with caching and privileged builds, so it is not free of operational work.
How long does a Jenkins migration take?
It depends on job count, plugin dependence and how bespoke the pipelines are. A tidy estate of straightforward builds can move in weeks, a large one over several months. We migrate by value and risk, run old and new together, and only retire Jenkins jobs once results match.
Can you fix a Jenkins server nobody dares to upgrade?
Yes. We clone it into a staging environment, upgrade core and plugins there, fix breakages, capture configuration as code and rehearse the production cutover with a rollback plan. The goal is a controller you can rebuild rather than one you are afraid to touch.

Talk to an engineer about Jenkins

Book a free 30-minute call. We review your current setup and tell you honestly whether and how we can help.

Written by Saddique Khan, DevOps / SRE / Cloud Consultant Engineer. Last updated 2026-10-09.