Drone

Drone Runner Kube High Resource Requests

We have been following the development closely of drone-runner-kube and it works really well for us.
The only thing I notice is when setting the limits using the environment variables is that it does it per container. This is able to limit well but because each service and step is a new container and they all have the limit it will request alot of resources.

Our example was one build had three steps and with a limit of 2cpus only needed 6 but then when we ran a build which needed 8 containers we then needed 16 cpus which we could not schedule.

I have been looking and I cannot seem to find a way to do limits across the entire pod so have just disabled them for now.

you can set resource limits for each pipeline step, for example:

steps:
  - name: build
    image: golang
    commands:
      - go build
      - go test
+   resources:
+     limits:
+       cpu: 1000
+       memory: 500MiB

Yep I could do that but I assume this would work the same. If I wanted 1 cpu for multiple steps it would need me to have 2 or more cpus free to allow the pod to get scheduled. Unless I make every step as small as possible I cant set limits and requests

I am not aware of any other options. Kubernetes defines resource limits per container [1], and Drone has to operate within the constraints of the Kubernetes scheduler.

[1] https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container