Skip to content

Add support for resources requests and limits #100

@AlexisColes

Description

@AlexisColes

The actions runner controller allows me to run a bunch of github agents waiting for container jobs in k8.
As these agents don't really do anything it would be good if I could keep a whole bunch of these agents running ready to pick up jobs as and when required with minimal resource requests.

resources:
        requests:
          cpu: 5m
          memory: 150Mi

I would then like the container jobs to define the amount of resources they want for each container and for this information to be passed through to the container spec.

jobs:
  container-test-job:
    runs-on: my-container-waiter
    container:
      image: node:14.16
      resources:
         requests:
           cpu: 500m
           memory: 2Gi
    services:
      postgres:
        image: postgres
         resources:
           requests:
             cpu: 500m
             memory: 2Gi

This would be very useful as we would not have to keep warm compute running for all the different permutations of required resources for out jobs and could just keep an amount of warm low priority compute to be share by all the different jobs.

Unfortunately there is no resources property for either a container or a service but maybe we can supply this information via the env property, something like.

jobs:
  container-test-job:
    runs-on: my-container-waiter
    container:
      image: node:14.16
      env:
         k8_resource_request_cpu:  500m
         k8_resource_request_memory: 2Gi
    services:
      postgres:
        image: postgres
        env:
           k8_resource_request_cpu:  500m
           k8_resource_request_memory: 2Gi

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions