# Can we create CPU pools and assign pods to the pool?

**URL:** <https://discuss.kubernetes.io/t/can-we-create-cpu-pools-and-assign-pods-to-the-pool/14982>\
**Category:** General Discussions\
**Created:** [February 25, 2021, 12:49pm UTC](https://discuss.kubernetes.io/t/can-we-create-cpu-pools-and-assign-pods-to-the-pool/14982 "2021-02-25T12:49:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![esudheere](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@esudheere](https://discuss.kubernetes.io/u/esudheere)\
**Post date:** [February 25, 2021, 12:49pm UTC](https://discuss.kubernetes.io/t/can-we-create-cpu-pools-and-assign-pods-to-the-pool/14982/1 "2021-02-25T12:49:00Z")

</div>

Asking for help? Comment out what you need so we can get more information to help you!

### Cluster information:

Kubernetes version: 1.18  
Cloud being used: Azure  
Installation method: az  
Host OS: Ubuntu 18.04  
CNI and version: Azure  
CRI and version: Docker

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

---

<div class="post-metadata">

**Author:** ![esudheere](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@esudheere](https://discuss.kubernetes.io/u/esudheere)\
**Post date:** [February 25, 2021, 6:25pm UTC](https://discuss.kubernetes.io/t/can-we-create-cpu-pools-and-assign-pods-to-the-pool/14982/2 "2021-02-25T18:25:52Z")

</div>

Any inputs?

Requirement is, In a cluster with 10 CPU cores, i need to allocate 6 cores to application A (multiple pods) and 4 cores to application B (Multiple pods). Any pods labelled as appA should use CPU from 6 core pool and appB from 4 core pool.

---

<div class="post-metadata">

**Author:** ![rata](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/rata/32/18244_2.png) [@rata](https://discuss.kubernetes.io/u/rata)\
**Post date:** [February 25, 2021, 8:45pm UTC](https://discuss.kubernetes.io/t/can-we-create-cpu-pools-and-assign-pods-to-the-pool/14982/3 "2021-02-25T20:45:14Z")

</div>

> [esudheere] esudheere [https://discuss.kubernetes.io/u/esudheere](https://discuss.kubernetes.io/u/esudheere)  
> February 25
> 
> Any inputs?

Sorry, there wasn’t any clear question before.

> Requirement is, In a cluster with 10 CPU cores, i need to allocate 6  
> cores to application A (multiple pods) and 4 cores to application B  
> (Multiple pods). Any pods labelled as appA should use CPU from 6 core  
> pool and appB from 4 core pool.

Yes, see the docs for node selectors.

---

<div class="post-metadata">

**Author:** ![esudheere](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@esudheere](https://discuss.kubernetes.io/u/esudheere)\
**Post date:** [February 26, 2021, 6:40am UTC](https://discuss.kubernetes.io/t/can-we-create-cpu-pools-and-assign-pods-to-the-pool/14982/4 "2021-02-26T06:40:50Z")

</div>

Nodeselector wont be helpful i think  
nodeA - total CPU core - 5  
nodeB - total CPU core - 5

Requirement is,  
appA pods should only use 6 cores  
appB pods should use only 4 cores

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [February 26, 2021, 7:06am UTC](https://discuss.kubernetes.io/t/can-we-create-cpu-pools-and-assign-pods-to-the-pool/14982/5 "2021-02-26T07:06:34Z")

</div>

Use quota and 2 different namespaces?

---

<div class="post-metadata">

**Author:** ![esudheere](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@esudheere](https://discuss.kubernetes.io/u/esudheere)\
**Post date:** [February 26, 2021, 11:59am UTC](https://discuss.kubernetes.io/t/can-we-create-cpu-pools-and-assign-pods-to-the-pool/14982/6 "2021-02-26T11:59:20Z")

</div>

Quota needs, requests and limits to be set for each pod. So the pod can not utilize the full pool capacity.

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [February 26, 2021, 3:47pm UTC](https://discuss.kubernetes.io/t/can-we-create-cpu-pools-and-assign-pods-to-the-pool/14982/7 "2021-02-26T15:47:05Z")

</div>

Use a LimitRanger in the namespaces to assign default values? Or require your users to set pod limits? Especially for mory, you want that anyway.
