Drone 1.0.0-rc5 on kubernetes - allocating/requesting cpu/mem for jobs

Hi there,

We’re experimenting with drone v1 with the long term goal of switching from drone 0.8.x.
Everything is looking very promising, the kubernetes integration is looking fantastic!

Is there a way to block/allocate cpu/mem resources per build?

In kubernetes every pod should (in theory) have a specified amount of cpu/memory resources which it reserves. Currently drone builds do not appear to have these in kubernetes. Is there an environment variable that I overlooked to set these?

Is it perhaps one of these?

    - name: DRONE_LIMIT_CPU_QUOTA
      value: "0"
    - name: DRONE_LIMIT_MEM
      value: "0"

Assuming that requested is the same as limits (which should be fine for this usecase).

Requesting/blocking the amount of needed cpu/mem would be most useful to avoid oversubscription.

Many thanks in advance!

With kind regards,

Daniel

3 Likes

Check this snippet:

kind: pipeline
name: lint

steps:
  - name: lint
    image: node:11.5-alpine
    commands:
      - npx --cache=/tmp/.npm-global prettier -l \"src/**\" index.html
    resources:
      limits:
        cpu: 111m
        memory: 200Mi

Awesome, muchas gracias!