The optional .spec.nodeSelector block limits the set of nodes where virtual machines (VMs) of this class run. Nodes are selected by labels:
spec:
nodeSelector:
matchExpressions:
- key: node.deckhouse.io/group
operator: In
values:
- green
A change to the .spec.nodeSelector block affects all virtual machines of the class at once. Those running on nodes that no longer match the new conditions have to be moved:
- In commercial editions, Deckhouse Platform (DP) migrates such VMs to suitable nodes.
- In DP Open, the VMs are restarted, and the restart time depends on the
.spec.disruptions.restartApprovalModeparameter of the virtual machine, which defaults toManualand requires the project owner’s approval.
To do the same in the web interface, in the VM class creation form:
- Click Add in the Conditions for scheduling VMs on nodes → Labels and expressions block.
- Set Key, Operator, and Value. They correspond to the
.spec.nodeSelectorparameter. - Press Enter to confirm the key parameters.
- Click Create.