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

**URL:** <https://drone.discourse.group/t/drone-1-0-0-rc5-on-kubernetes-allocating-requesting-cpu-mem-for-jobs/8726>\
**Category:** Drone Support\
**Created:** [January 28, 2019, 3:03pm UTC](https://drone.discourse.group/t/drone-1-0-0-rc5-on-kubernetes-allocating-requesting-cpu-mem-for-jobs/8726 "2019-01-28T15:03:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![genisd](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/genisd/32/3535_2.png) [@genisd](https://drone.discourse.group/u/genisd)\
**Post date:** [January 28, 2019, 3:03pm UTC](https://drone.discourse.group/t/drone-1-0-0-rc5-on-kubernetes-allocating-requesting-cpu-mem-for-jobs/8726/1 "2019-01-28T15:03:14Z")

</div>

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?

```auto
    - 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

---

<div class="post-metadata">

**Author:** ![laszlocph](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/laszlocph/32/3233_2.png) [@laszlocph](https://drone.discourse.group/u/laszlocph)\
**Post date:** [February 7, 2019, 2:38pm UTC](https://drone.discourse.group/t/drone-1-0-0-rc5-on-kubernetes-allocating-requesting-cpu-mem-for-jobs/8726/2 "2019-02-07T14:38:27Z")

</div>

Check this snippet:

```auto
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

```

> <https://github.com/drone/drone-runtime/pull/29#issuecomment-461004242>
>
> fixes #17 
> 
> please note that cpu needs https://github.com/drone/drone-yaml/pul…l/17 in order to work. Otherwise it will not add anything.
> 
> \`CPU\` is modified from int64 to string because with int64 it is impossible? to get it working. \`int64(1)\` in kubernetes means 1 CPU, and if we want to use less than one cpu we need to use string.

---

<div class="post-metadata">

**Author:** ![genisd](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/genisd/32/3535_2.png) [@genisd](https://drone.discourse.group/u/genisd)\
**Post date:** [February 7, 2019, 3:10pm UTC](https://drone.discourse.group/t/drone-1-0-0-rc5-on-kubernetes-allocating-requesting-cpu-mem-for-jobs/8726/3 "2019-02-07T15:10:37Z")

</div>

Awesome, muchas gracias!
