virtualization
virtualization copied to clipboard
feat(moduel): add nodeSelector for workload
Description
This change introduces a new module configuration option .workload.nodeSelector that allows users to define node labels for scheduling virtual machine workloads.
When set, only nodes matching the specified labels will be eligible to run virtual machines. If not set, the default kubernetes.io/os=linux is used, ensuring VMs are scheduled on Linux-based nodes by default.
Why do we need it, and what problem does it solve?
Before this change, there was no straightforward way to control which nodes can run virtual machines. This made it difficult to enforce placement policies, such as isolating VM workloads to specific nodes.
With this update, users gain fine-grained control over VM scheduling using standard Kubernetes node selectors.
What is the expected result?
After applying this change:
- Virtual machines will only be scheduled on nodes whose labels match the configured nodeSelector.
- If no custom selector is provided, VMs will still only run on Linux-based nodes (default behavior).
Checklist
- [ ] The code is covered by unit tests.
- [ ] e2e tests passed.
- [ ] Documentation updated according to the changes.
- [x] Changes were tested in the Kubernetes cluster manually.
Changelog entries
section: module
type: feature
summary: New module config `.workload.nodeSelector` option to control which nodes can run virtual machines based on labels. Defaults to `kubernetes.io/os=linux` if not set.