Is there a way to enforce all the replicas of a k8s deployment to schedule on the same node as much as possible? For example, the available GPUs are 8 on every node, and I have 8 replicas, where each of them requires one GPU. Can I enforce all the replicas schedule on the same node?
And if i have 15 replicas, i would like to enforce them to schedule on two nodes.
While Kubernetes doesn't have a direct mechanism to enforce all replicas onto a single node, you can leverage these techniques to achieve a similar outcome: