What is Kubernetes max available cpu/mem resourceQuota for a namespace?

3/6/2019

Is Kubernetes max available cpu/mem resourceQuota for a namespace the total of #cpu across all nodes in the cluster or per node? i.e if I have 4 nodes each with cpu=10 and mem=100Gi, to set 50% resources to the namespace, would that be limits.cpu: "20" (4*10/2) or "5" (10 per node/2). I'm using statefulsets w/label+namespace for node selection so that pods are specifically deployed to use only these 4 nodes. I think it would have to be the latter, so: limits.cpu: "5" limits.memory: 50Gi would allow each node in that namespace to use 50% of the resources. One reason I ask is it may not always be true that each node has the same number cpu/memory, i.e. 50% resources on one node may not be 50% on another node - in my cluster they are the same, but I can see where that might not be the case.

-- bladerunner512
kubernetes

1 Answer

3/6/2019

it's the sum of CPU of all worker nodes

enter image description here

Source: https://kubernetes.io/docs/concepts/policy/resource-quotas/#compute-resource-quota

If Pods in Running state exceeds that amount k8s fails to schedule the Pods because there aren't nodes available to fulfill the request

-- Hernan Garcia
Source: StackOverflow