I can only find documentation online for attaching pods to nodes based on labels. Is there a way to attach pods to nodes based on labels and count - So only x pods with label y?
Our scenario is that we only want to run 3 of our API pods per node. If a 4th API pod is created, it should be scheduled onto a different node with less than 3 API pods running currently.
Thanks
No, you can not schedule by count of a specific label. But you can avoid co-locate your pods on the same node.
You can use podAntiAffinity
and topologyKey
and taints
to avoid scheduling pods on the same node. See Never co-located in the same node