Is it possible to have dynamic slaves with multiple build execution lanes using Kubernetes plugin for Jenkins?
I currently have a jenkins scripted pipeline job that is trying to run a parallel instruction with 25 branches and this is hitting a soft limit (Container Cap/Max number of instances) configured in our Kubernetes Jenkins slave cloud.
Currently, each pod that gets created on demand to be a build slave, possesses only one build lane and I wonder if is there a way to spread the workload amongst existing slave pods.
You can use the deployment or replication set model of the kubernetes framework. This will automatically scale the pods based on the load and number of replicas required. Moreover, the underlying hardware shall also support the same.
A Deployment is more powerful and robust than a job/pod of a kubernetes.
It is not possible to somehow reuse slave pods by Kubernetes plugin.
Kubernetes slaves designed to be a stateless, run only one job and die after. That 's why
But, for example, you can create a Pipeline which will get a list of all branches and run them in parallel inside one job/pod.
But anyway, you need to do it by yourself, Kubernetes plugin has no automation for it.