Understanding the scheduling limitations in Jenkins with kubernetes plugin

Hi there!

We use Jenkins with k8s plugin for running most of the builds.
As we provide more support, hundreds of builds are getting migrated from the old infrastructure the the new one, which obviously offers much more flexibility and consistency.

That said, oftentimes it may take minutes for a given build to obtain a build pod on a busy day. We would like to understand and debug pods scheduling requirements to provide a more responsive experience.

From the link provided on the plugin website:

Right now the default scheduler is random, but resource based scheduling will be implemented soon. At the time of writing there are several issues opened to add scheduling based on memory and CPU usage

It seems like the resource based scheduling was supposed to be implemented soon (the article is from 2014), but it seems it’s still random?

Jenkins setup:

  • Jenkins version: 2.440.3
  • k8s plugin version: 4211.v08850dd0dfa_3
  • k8s cluster:
    1. Ubuntu 22.04 k8s controller node
    2. Three Ubuntu 22.04 worker nodes for Linux builds
    3. Single Windows Server 2019 worker node for Windows builds