I think there’s a misconception repeated within the Jenkins community based on conference materials. The misconception is a single controller is a bad idea and that it doesn’t handle lots of jobs or lots of agents very well. Jenkins can scale up to operate for a global company. I’ve done it at two separate companies.
Current setup: I operate a similar JaaS and it currently has 256,000 jobs. It operates on c7g.4xlarge (arm64 32GB RAM) and its startup time is a little under 5 minutes. It uses a mix of Job DSL, config as code, multibranch pipelines, and (more recently to my woes) organization job types. My 256k job count is the count of WorkflowJob count (of which a multibranch pipeline would have more than one).
Put another way: over 4000 engineers can collaborate through a single Jenkins controller if carefully designed. I have achieved this.
Over the years I’ve put out patches that make “one Jenkins instead of many” more and more reliable. Whether lots of GitHub retries with jitter backoff in plugins, the “ludicrous mode” patch series or more recently my EC2 work and unblocking parallelism in sshagent and docker plugins.
How Jenkins could be better: Jenkins can scale even further for less if work on org jobs migrated to graphql instead of REST. The information GitHub org jobs consumes for orgs with over 1000 repositories amounts to 10k+ REST API calls. The same information obtained from graphql can be obtained for 100 API calls in a few seconds compared to REST.
It is my professional opinion that rolling out many Jenkins instances is a design mistake and not to be encouraged. Jenkins (the community) should start looking more at how it handles its own internal config to stop using JVM memory dumps to XML and instead something a little more modern where HA can be achieved.
Even without active-active HA you can easily have cold-failover HA. My controller is hosted in EC2 with an autoscaling group (desired capacity = 1, max capacity = 1). My Jenkins downtime is usually the result of a GitHub outage (more recently) as opposed to blaming Jenkins itself. It serves a globally distributed company with offices in US, EU, Asia (single controller hosted in US).
The biggest challenge which faces @Abinash is not that Jenkins can’t achieve the scale… in order to achieve that scale you tend to need more than the technical expertise. You’re going to need the political will from leadership top-down and people to understand… because migrating such a design you’ve described is a multi-year project that requires social coordination as much as it does migration of process.
Examples:
- Forcing everyone into the same workflow.
- DRYing up the process with a shared pipeline library.
- Credentials need to be workflow-aware. e.g. different environments get different creds (PRs shouldn’t deploy to all of prod… prod can only happen in a specific stage in a tag pipeline).
- Managing a process for handling credentials. e.g. there needs to be as many AWS roles as there are projects (or in some cases a role can be shared for a group of projects).
- With said AWS roles ephemeral credentials issuing ephemeral credentials via Amazon STS on the fly in pipelines so the deploy creds expire.
- GitHub credentials that are ephemeral.
- Other systems like databricks credentials which can be ephemeral through service principals.
Basically, a “Jenkins at scale” means as admin for an entire organizations productivity you have to be enabled to enact change. You have to sell the idea of the migration in a way that provides value.
That’s just the tip of the iceberg. I’ve written plugins which exports Jenkins logs to artifact hosts so that strict cleanup policies can be enacted to keep Jenkins running fast (like pull requests are deleted older than two weeks, etc). Automated offboarding like when repos are archived. Required Jira tracking where pull requests are not allowed to be merged without work attached to a ticket.
To roll something like this when you already have a system that’s limping but works (like 60 controllers) takes A LOT of buy in for you to be able to force it through where there’s resistance. Executives need to be willing to interrupt product work (and override teams that are unwilling with the excuse of product work which usually is a pretty good excuse).
It is do-able I am just sharing some difficulties having done it. Good luck!