Jenkins vs GitHub Actions vs GitLab CI, and Running Jenkins at Scale: High Availability and Multiple Controllers
The Main CI/CD Tools
| Tool | Model | Where config lives |
| Jenkins | Self-hosted controller and agents, huge plugin ecosystem | Jenkinsfile (Groovy) plus controller settings (JCasC) |
| GitHub Actions | Hosted by GitHub (or self-hosted runners), tight GitHub integration | YAML in .github/workflows/ |
| GitLab CI/CD | Built into GitLab, hosted or self-managed, runners | .gitlab-ci.yml |
| CircleCI, Azure Pipelines, Bitbucket Pipelines, Argo Workflows, Tekton | Hosted or Kubernetes-native | YAML |
Side-by-Side Comparison
| Topic | Jenkins | GitHub Actions | GitLab CI |
| Hosting | You run it | Hosted (plus self-hosted runners) | Hosted or self-managed |
| Setup effort | Higher: servers, updates, plugins | Low | Low to medium |
| Flexibility | Very high: any language, system or odd network | High, within GitHub model | High, within GitLab model |
| Ecosystem | Thousands of plugins | Marketplace of reusable actions | Templates and built-in features |
| Pipeline language | Groovy Declarative and Scripted | YAML with reusable workflows | YAML with includes and templates |
| Source control | Any (Git, SVN, Perforce...) | GitHub only | GitLab only (mirroring possible) |
| Security and compliance | Fully in your control, but you must harden and patch | Provider-managed platform; you manage workflow security | Integrated scanners in higher tiers |
| Cost | Free software; you pay for servers and people | Free minutes, then per minute or per runner | Tiers; runners can be your own |
| Maintenance | You update Jenkins, plugins, Java, agents | Provider handles the platform | Provider or you |
| Large or special builds (GPU, mainframe, air-gapped) | Excellent fit | Self-hosted runners | Self-managed runners |
| Learning curve | Steeper (Groovy, plugins, admin) | Gentle | Gentle |
When Jenkins Is a Good Choice
- You need full control or must run on your own network (regulated, air-gapped, on-prem)
- Your code lives in many different systems (several Git hosts, Perforce, SVN)
- You have complex, long or custom pipelines and existing Jenkins skill
- You rely on a plugin with no easy replacement
- You want to avoid being tied to one code host
When to Consider GitHub Actions or GitLab CI
- All code is on one platform and the team wants less to operate
- You have no one to maintain a CI server
- You want pipelines next to the pull request and issue experience
- Your pipelines are standard (build, test, deploy a container) and well covered by marketplace actions
Mixing is normal: Many companies run GitHub Actions for open-source or simple repositories and Jenkins for legacy or special builds. Choose per need, not by fashion.
Migration Notes
| Jenkins | GitHub Actions equivalent |
pipeline { stages { ... } } | jobs: with steps: |
agent { label 'linux' } | runs-on: ubuntu-latest or a self-hosted label |
environment { X = 'y' } | env: |
withCredentials | secrets.NAME |
parallel | Jobs without needs: run in parallel; matrix |
when { branch 'main' } | if: github.ref == 'refs/heads/main' |
input approval | Environments with required reviewers |
| Shared library | Reusable workflows and composite actions |
archiveArtifacts | actions/upload-artifact |
yaml
# Same idea as a simple Jenkins pipeline, in GitHub Actions
name: ci
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with: {distribution: temurin, java-version: 21, cache: maven}
- run: ./mvnw -B verify
- uses: actions/upload-artifact@v4
with: {name: jar, path: target/*.jar}
- Migrate one repository at a time, running both pipelines in parallel until you trust the new one
- Move logic into scripts first (see the best practices lesson): that makes any migration easy
- Do not translate line by line; redesign using the new tool's strengths
Sizing and Scaling Jenkins
| Part | Guidance |
| Controller | Orchestrates only: UI, queue, scheduling, pipeline engine. Start with 4 CPU, 8 to 16 GB RAM, fast SSD; tune heap (see monitoring lesson). 0 executors |
| Agents | Do the work. Scale horizontally. Use ephemeral Kubernetes pods, Docker agents, or cloud autoscaled VMs |
| Storage | Fast disk for JENKINS_HOME; build artifacts in an external repository, not on the controller |
| Network | Low latency to Git host and artifact repository |
- Typical limits: very large installations slow down as job count, plugins and history grow. When the UI or queue is slow even after tuning, split controllers
- Use many small controllers (per team or business unit) instead of one giant one: failures and upgrades affect fewer people
- Standardize all controllers with JCasC, the same plugin list and shared libraries
High Availability Options
Open-source Jenkins has one active controller. It does not run two active controllers on the same JENKINS_HOME. You still have good options for resilience.
| Approach | How it helps |
| Fast recovery (recommended) | Controller as a container or VM with JENKINS_HOME on a replicated or snapshot volume, config in Git. If it fails, start a new one in minutes. Running builds on agents can reconnect or restart |
| Kubernetes with a persistent volume | Kubernetes restarts the controller pod and re-attaches storage |
| Active/passive pair | Standby ready with shared or replicated storage, switched by a load balancer or script. Never run both active at once |
| Several independent controllers | Failure of one affects only its teams |
| Commercial options (for example CloudBees CI) | Add features such as managed controllers and high availability. Check the vendor's documentation |
- Make the controller restart-safe: pipelines survive controller restarts when durable (
durabilityHint), but agents must stay connected or retry
- Keep agents stateless so they can be replaced at any time
- Practise disaster recovery: restore from backup into a new region or cluster and time it
Jenkins on Kubernetes at Scale
- Use the official Helm chart; keep controller image and plugins in your registry
- Set resource requests and limits for controller and agent pods; use node pools or taints for build workloads
- Use cluster autoscaling so build pods can wait for nodes
- Cache dependencies with persistent volumes or a proxy repository
- Limit concurrency per team with quotas (
ResourceQuota) to prevent one team from taking the cluster
A Platform Team Model
| Team | Responsibility |
| Platform / DevOps team | Run Jenkins, agents, plugins, security, shared libraries, templates, support |
| Product teams | Own their Jenkinsfiles and pipelines, using the standard library |
| Security team | Define policy gates, review exceptions |
- Offer golden paths: a template pipeline that is secure and fast out of the box
- Publish docs, examples and a support channel
- Track cost per team: agent time and cloud resources
- Review the platform regularly: do we still need Jenkins for this workload?
Practice Tasks
- Rewrite a small Jenkins pipeline as a GitHub Actions workflow and list what changed
- List the plugins your Jenkins uses and mark which have an equivalent in your alternative
- Write a recovery plan for Jenkins: where is data, how long to restore, who runs it
- Estimate controller and agent capacity for 50 developers and 200 builds a day
- Test a controller restart while a pipeline runs and see what survives
Conclusion
Jenkins gives full control, any source system and a huge plugin set, but you operate it. GitHub Actions and GitLab CI are lighter when your code is on one platform. At scale, keep controllers for orchestration with zero executors, use ephemeral agents, split into several controllers if needed, define everything as code, and plan fast recovery because open-source Jenkins has one active controller.
Quick Summary: tool comparison; when Jenkins vs hosted; migration mapping + YAML; sizing; HA options (fast recovery, K8s, active/passive); K8s scaling; platform team.