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.restartApprovalMode parameter of the virtual machine, which defaults to Manual and requires the project owner’s approval.

To do the same in the web interface, in the VM class creation form:

  1. Click Add in the Conditions for scheduling VMs on nodesLabels and expressions block.
  2. Set Key, Operator, and Value. They correspond to the .spec.nodeSelector parameter.
  3. Press Enter to confirm the key parameters.
  4. Click Create.

Additional resources