On our Kubernetes(AKS) cluster we have multiple node pools some with Linux nodes and some with Windows nodes:
But what if you want to schedule specific workloads on Linux or Windows nodes? The easiest way to control this is through the OS node selector. The OS node selector(“kubernetes.io/os”) is a built-in selector which indicates the OS that the node is running. We can use this selector to ensure that the pod is only deployed to nodes with the right OS.
Here is an example for Windows pods:
And here is in example for Linux pods:
Unfortunately you don’t always have direct control on the pod specification(e.g. when you are using a 3th party Helm chart). In that case we have to take a different approach. But that is for another blog post tomorrow…