Allow configuration of requests and limits for Kubernetes Executor
Description
Currently, the configuration of the Kubernetes executor allows specifying the CPU and Memory allocations for build, helper and service containers. However, using the existing options (e.g. cpus
and memory
), the values provided are set as both requests and limits values on the created pods. There are scenarios where it would be useful to define different values.
For example, we have a system which doesn't have that many builds running on it all the time. However, at peak times, there could be multiple simultaneous builds. Let's say we have the cluster running on machines with 2 CPUs. If we set up the allocations for a build at 1 CPU, we could theoretically run 2 builds in parallel (for simplicity I'm ignoring the resources required by the kluster itself). However, if we have only 1 build running, it will still use a single CPU and thus take twice the optimal amount of time. However, it would be great if we could set the required CPU at 1 (thus allowing 2 simultaneous builds) and limit at 2 (thus allowing it to use the whole system when there's a single build).
Proposal
Allow a way for specifying both requested resource allocations and limits for them, independently.