Hosting workload on the right node in Kubernetes
Are you running Kubernetes as a Platform for the Application teams to run their services? If yes, then very soon you will have some of the typical requests coming from the Teams saying —
- Our service is compute heavy and we want to get the service pods hosted on a Compute heavy node and not a generic one.
- Pods of these two specific services should always be running on the same node.
- This is an AI/ML specific service and it should always be running on a GPU based node.
- My service can run on any node provided the node has SSD type storage.
- And this list literally can just go on, and on, and on.
Or, maybe as a Platform team, you might collaborate with the Application teams to identify stateless workload and if it can be run on Spot instances, may be on lower environments if not in production. This helps you to implement the Cost saving strategy from Day 0. I know it sounds premature optimisation, but if properly planned, can be done right in the 1st attempt.
Well, if you are in this situation, nothing to panic as Kubernetes has Out of box features which can help you implement the above ask in a very clean way. These features in Kubernetes are known as —
- Node selector or Node Affinity &