# Workloads on same node

**URL:** <https://forums.suse.com/t/workloads-on-same-node/14188>\
**Category:** SUSE Rancher Prime\
**Created:** [May 7, 2019, 12:45pm UTC](https://forums.suse.com/t/workloads-on-same-node/14188 "2019-05-07T12:45:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dc.901](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@dc.901](https://forums.suse.com/u/dc.901)\
**Post date:** [May 7, 2019, 12:45pm UTC](https://forums.suse.com/t/workloads-on-same-node/14188/1 "2019-05-07T12:45:23Z")

</div>

Hello,  
I have Rancher 2.2.2 in HA and have custom nodes.  
I have two workloads that communicate with each other (this works fine).  
But, what I want to do now is to make sure these two workloads are always on same node.  
I looked thru Node Scheduling. I do not want to tie these workloads to a specific node as nodes may go down for maintenance.  
So, what is my best option to make sure the two workloads are always running together on same node?  
Thanks!

---

<div class="post-metadata">

**Author:** ![Fraser\_Goffin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/fraser_goffin/32/6608_2.png) [@Fraser\_Goffin](https://forums.suse.com/u/Fraser_Goffin)\
**Post date:** [May 12, 2019, 10:50am UTC](https://forums.suse.com/t/workloads-on-same-node/14188/2 "2019-05-12T10:50:17Z")

</div>

NodeSelector or Affinity/AntiAffinity + Taints/Tolerances

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [May 12, 2019, 7:18pm UTC](https://forums.suse.com/t/workloads-on-same-node/14188/3 "2019-05-12T19:18:52Z")

</div>

What you want is [pod affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature), which is a beta k8s feature. You can use it, but there’s no controls in the Rancher UI for it.

---

<div class="post-metadata">

**Author:** ![Fraser\_Goffin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/fraser_goffin/32/6608_2.png) [@Fraser\_Goffin](https://forums.suse.com/u/Fraser_Goffin)\
**Post date:** [June 3, 2019, 8:27pm UTC](https://forums.suse.com/t/workloads-on-same-node/14188/4 "2019-06-03T20:27:16Z")

</div>

Indeed, just use the native K8s api, no need to be constrained by Rancher. That’s always the problem with UI’s, or indeed custom API’s, they are nearly always a constraint model. Much as I like Rancher, it’s not the only tool in the box.
