cpu and gpu resourcequota on kubernetes

9/3/2019

Team, I am unable to understand the Used vs Hard set limits. How come used section shows requests.nvidia.com/gpu: "640" where as I set requests.nvidia.com/gpu: "1" ? and same for request.cpu is 1 but shows 80?

apiVersion: v1
kind: ResourceQuota
metadata:
  creationTimestamp: "2019-09-01T21:38:31Z"
  name: mem-cpu-demo
  namespace: maglev-ee630119-711f-487e-975f-c297fd6a7577
  resourceVersion: "23545076"
  selfLink: /api/v1/namespaces/7577/resourcequotas/mem-cpu-demo
  uid: 94a6
spec:
  hard:
    limits.cpu: "2"
    limits.memory: 2Gi
    limits.nvidia.com/gpu: "1"
    requests.cpu: "1"
    requests.memory: 1Gi
    requests.nvidia.com/gpu: "1"
status:
  hard:
    limits.cpu: "2"
    limits.memory: 2Gi
    limits.nvidia.com/gpu: "1"
    requests.cpu: "1"
    requests.memory: 1Gi
    requests.nvidia.com/gpu: "1"
  used:
    limits.cpu: "5760"
    limits.memory: 34560Gi
    requests.cpu: "80"
    requests.memory: 80Gi
    requests.nvidia.com/gpu: "640"
-- AhmFM
kubernetes
namespaces

1 Answer

9/3/2019

Resourcequotas are enforced when a new object is created, it has no effect over existing pods, it don't try to crush pods already running. Also the unit of consumed cpu are millicores 1 thousand of a core.

-- EAT
Source: StackOverflow