Skip to content

How to scale down a specific node in a node pool with Elemental

Article Number: 000022080

Environment

Rancher

Elemental

RKE2

Situation

When scaling down a Rancher-provisioned Elemental RKE2 cluster node pool after modifying the MachineInventorySelectorTemplate, the oldest node in the pool is removed — rather than the node that no longer matches the updated selector.

This behavior is expected.
The MachineInventorySelectorTemplate is evaluated only once, during initial creation, to generate selectors.
Subsequent edits to the template do not propagate to existing selectors or machines that were previously created.

For instructions on how to remove a specific machine or node from a node pool, refer to the Resolution section below.

Cause

During node pool scaling operations, the MachineInventorySelectorTemplate is not referenced.
Instead, the oldest node is selected for removal to maintain the desired node count and to prevent unintended deletions that could occur due to mismatches between:

  • Labels defined in the MachineInventorySelectorTemplate, and
  • Labels present on existing MachineInventory objects.

This safeguard ensures consistent and predictable scaling behavior, even when template labels are later modified.

Resolution

To delete a specific node or machine from a pool, you can perform the operation via the Rancher UI or kubectl.

Option 1: Using Rancher UI

  1. Navigate to the cluster and locate the node you want to remove.
  2. Select the node and scale down the node pool.
  3. Rancher automatically applies the following annotation to the targeted machine:

cluster.x-k8s.io/delete-machine: "true"

Option 2: Using kubectl

  1. Identify the target machine object.
  2. Manually apply the deletion annotation:

apiVersion: cluster.x-k8s.io/v1beta1
kind: Machine
metadata:
  annotations:
    cluster.x-k8s.io/delete-machine: "true"

  1. Scale down the node pool to complete the deletion process.