Kubernetes requests and limits relationship

5/16/2021

I've specified that i want to use 4 vcpu's in my resource request

This doesn't line up with what im seeing when i describe the node

  Resource                    Requests    Limits
  --------                    --------    ------
  cpu                         410m (10%)  100m (2%)
  memory                      440Mi (2%)  640Mi (4%)

I didnt specify limits, this looks like the limit is below the requested resources, is this the case? If so do i need to specify a limit?

Here is my manifest:

kind: Workflow
metadata:
  name: ensembl-orthologs
  namespace: argo-events
  generateName: ensembl-orthologs-
spec:
  entrypoint: ensembl-orthologs
  templates:
    - name: ensembl-orthologs
      nodeSelector:
        instanceType: t3.xlarge
      resources:
        requests:
          memory: '16G'
          cpu: '4'
      container:
        image: REDACTED
        imagePullPolicy: Always
        volumeMounts:
          - name: REDACTED
            mountPath: REDACTED
       
-- Happy Machine
amazon-eks
argo-workflows
kubernetes

1 Answer

5/16/2021

If you don't specify a limit on CPU or RAM then that resource isn't limited. The percentage/totals on limits are mostly just for reference to humans, limits can (and usually do) end up higher than requests when set but setting CPU limits can be counter productive (I do recommend setting a memory limit to improve system stability, even if its very high).

Also you are setting things on an workflow object that doesn't appear to be running, so those pods wouldn't count towards the current total.

-- coderanger
Source: StackOverflow