<p>Kubernetes: what happens when a pod has no resources limits / requests defined?</p>

<p>How much resources can a pod use in Kubernetes (GKE) when it has no (or only partial) resource limits/requests defined?</p>

<p>For example, I have a pod with only memory <em>limits</em> and memory <em>requests</em>, but it has no cpu specs. 
Will the cpu available to this pod be:</p>

<ul>
<li>0</li>
<li>as much as left on the node/namespace (total minus all other pod claims)</li>
<li>as much as possible regarding <em>actual</em> use by other pods on the node/namespace</li>
</ul>

<p>If you do not specify a CPU limit for a Container, then one of these situations applied:</p>

<p>The Container has no upper bound limit on the CPU resources it can use. The Container can use all of the CPU resources available on the Node where the pod is running. So in your case it will be second option which you have specified in your question : as much as left on the node/namespace.</p>

<p>Normally Kubernetes Cluster Administrator defines the limit for each and every namespace in cluster. so the Container is running in a namespace that has a default CPU limit, and the Container is automatically assigned the default limit.</p>

<p>Resource Quota should be defined for each Namespace which comes in handy to get rid of pods that don't have resource request or limits and eating up all the resources. This means you can not schedule the pod until you specify the resource requirements for that pod in particular namespace and this is recommended as best practices</p>

<p>For more information you could refer to this section : <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#if-you-do-not-specify-a-cpu-limit" rel="noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#if-you-do-not-specify-a-cpu-limit</a></p>
