Node Operations
For day-to-day node management, use the cubeopscli CLI on the control node, or the WebUI node detail page (port 12088).
This page covers the main compute-node operations in a CubeSandbox cluster: inspecting node compatibility, managing machine types and node labels, and adding, isolating, or deleting nodes.
cubeopsclireaches the CubeOps service at127.0.0.1:3010by default. For split deployments such as the Terraform cluster edition, point it at the control-plane address with--addressand--port.
Use the following commands to confirm node IDs and the current state:
cubeopscli node list
# Query one node
cubeopscli node list --hostid <node_id>Node identity and dynamic IP resolution
CubeSandbox separates a compute node's stable identity (node_id / InstanceID) from its dialable address (HostIP / endpoint IP) so that control-plane and data-plane traffic can follow a node even if its IP changes.
How node_id and endpoint IP are selected
On startup, cubelet resolves its identity in the following precedence order (Cubelet/pkg/utils/cloud.go):
node_id(stable node identity):CUBE_SANDBOX_NODE_ID— highest priority; can be any stable identifier. In Kubernetes Helm deployments, the chart injectsspec.nodeNamevia the Downward API sonode_idstays unchanged acrosscube-nodePod restarts or recreations on the same Kubernetes node.CUBE_SANDBOX_NODE_IP— used whenCUBE_SANDBOX_NODE_IDis unset (the default in one-click / systemd / Terraform bare-metal deployments, where the host IP is static and doubles asnode_id).- Auto-detected primary non-loopback IPv4 address (default route interface → outbound IPv4 → first non-loopback IPv4) when neither environment variable is set.
- Endpoint IP (dialable
HostIP):CUBE_SANDBOX_ENDPOINT_IP— in Kubernetes Helm deployments, the chart injectsstatus.podIPvia the Downward API.- Otherwise, if
node_idis a valid non-loopback IPv4 address, reusenode_id. - Otherwise, fall back to the auto-detected primary non-loopback IPv4 address.
Requirement for dynamic IP tracking: To keep control-plane and data-plane communication unaffected across IP changes,
node_idmust remain stable when the IP changes (i.e., setCUBE_SANDBOX_NODE_IDexplicitly or use the Kubernetes Helm chart defaultspec.nodeName). IfCUBE_SANDBOX_NODE_IDis unset andnode_idfalls back to the node's IP, an IP change is treated as a new node identity.
How control plane and data plane track IP changes
When a compute node re-registers with the same node_id and a new HostIP:
- CubeOps updates the node's
HostIPin storage and publishesnode_id -> host_ipinto the shared Redis Hashcube:v1:shared:node:endpointon registration and every heartbeat (and deletes it when the node is deleted). Subsequent heartbeats preserve the latest registeredHostIP. - CubeMaster records
HostIDalongsideHostIPacross sandbox proxy routes, in-memory caches, pause snapshots, async tasks, and status reconcilers, resolving the liveHostIPbynode_idbefore dialingcubelet. When a node's IP changes, CubeMaster automatically closes stale gRPC connections to the previous IP. - CubeProxy stores
HostIDin its local route cache and resolves the live upstream IP fromcube:v1:shared:node:endpoint(cached locally with a 10s freshness TTL, single-flight refresh, and a longer last-known-IP fallback with 1s error backoff during Redis outages, without purging existing sandbox route entries).
Backward compatibility & rolling upgrades:
- Existing
sandbox:proxy:{sandboxID}entries withoutHostIDautomatically fall back to their staticHostIPin both CubeMaster and CubeProxy. - Recommended rolling upgrade order: upgrade CubeOps first (heartbeats populate
cube:v1:shared:node:endpointwithin ~10s), then CubeProxy and CubeMaster. (Upgrading CubeMaster before CubeProxy is also safe because older CubeProxy ignoresHostIDand continues using staticHostIP.) - Multi-replica CubeMaster rolling upgrade: avoid cross-node Resume while old and new CubeMaster replicas coexist. An old replica does not know about
HostIDand would updateHostIPwithout clearing aHostIDwritten by a new replica, leavingHostIDpointing at the previous node until all replicas finish upgrading. - Rollback: rolling back CubeMaster from a new version to an old version leaves existing
HostIDfields in Redis intact; if the old CubeMaster later performs a cross-node Resume, it only rewritesHostIPwhile a new CubeProxy keeps resolving the staleHostIDto the previous node. Roll back CubeProxy first (or remove theHostIDfield from affectedsandbox:proxy:{sandboxID}entries). - CubeProxy reload behavior: pre-upgrade cached routes in shared memory lack the
HostIDfield and will trigger a one-time reload from Redis on first access after an in-place nginx reload.
Node groups
Cross-node restore of a sandbox requires the source and the target node to have exactly the same CPU and kernel; we call such machines the same node type. A memory snapshot taken on one node type can only be restored onto the same node type.
List the node types in the cluster and their members:
cubeopscli node groupsExample output (compact by default — group, CPU identity, member count and nodes):
GROUP CPU_VENDOR CPU_MODEL COUNT NODES
type-1 GenuineIntel Intel(R) Xeon(R) ... 3 node-1,node-2,node-3
type-2 AMD AMD EPYC 7B13 ... 2 node-4,node-5(cordoned)- Nodes in the same group can restore each other's memory snapshots cross-node; nodes in different groups cannot.
- Node markers:
(down)unhealthy,(cordoned)scheduling disabled,(tainted)the live KVM module carries a suspicious taint. unknowngroups nodes that reported nocpuid_hash/host_kernel_release(for example, a cubelet old enough to never collect them). Their class cannot be verified, so cross-node restore fails closed for them.
Use this to see how many node types a cluster mixes before building templates on shared backends, scheduling cross-node restores, or planning rolling host-kernel upgrades.
Machine types
A machine type declares a group of nodes that may restore memory snapshots onto each other.
The default cross-node restore rule requires the source and target nodes to share the same CPU and an identical host kernel. After a rolling host-kernel upgrade, machines that differ only by a kernel patch level get blocked, although their memory state is compatible. Binding such machines to one machine type waives the kernel requirement:
- Create a machine type and bind nodes to it in the WebUI (Nodes → Machine types) or with
cubeopscli machine-type. - A bound node carries the label
cube.cubesandbox.io/machine-type=<name>; a node without the label is simply unbound — nothing to enable per node. - A machine type waives only the kernel comparison; the CPU must still match.
Restore compatibility then works as follows:
| Source node | Target must match |
|---|---|
| No machine type | cpuid_hash and host_kernel_release (unchanged) |
Machine type <T> | Machine type <T> and cpuid_hash; the host kernel is no longer compared |
After binding, a node restores only onto nodes with the same machine type and cpuid_hash; unbound nodes are excluded even when CPU and kernel match. When enabling a type for a group that could already restore between its members, bind the whole group.
A machine type that contains more than one CPU only produces a warning — those nodes still cannot restore onto each other. To see the CPU and kernel spread inside a type, use cubeopscli machine-type get <name>.
Deleting a type that still has nodes bound requires unbinding them at the same time (CLI: --unbind).
# Create a machine type and bind its first nodes.
cubeopscli machine-type create intel-oc9-k66 \
--display-name "Intel OC9" \
--description "same CPU, mixed host kernel" \
--nodes node-1,node-2
# Inspect types: members, CPU and kernel spread, warnings.
cubeopscli machine-type list
cubeopscli machine-type get intel-oc9-k66
# Bind or unbind single nodes later; bind moves a node off its previous type.
cubeopscli machine-type bind intel-oc9-k66 node-3
cubeopscli machine-type unbind node-3
# Find nodes by type assignment.
cubeopscli node list --machine-type intel-oc9-k66
cubeopscli node list --unassigned-machine-type
# Deleting a type with bound nodes requires --unbind.
cubeopscli machine-type delete intel-oc9-k66 --unbindThe same commands are available as cubeopscli node machine-type ….
Node labels
Nodes carry free-form labels for your own bookkeeping, for example team=infra or zone=gz:
cubeopscli node label list node-1
cubeopscli node label set node-1 team=infra
cubeopscli node label replace node-1 team=infra zone=gz
cubeopscli node label delete node-1 teamset adds or updates single labels, while replace installs the complete label set: any label missing from the command is deleted. System labels — the machine type, isolation state, and the data-plane labels reported by Cubelet (kubernetes.io/*, beta.kubernetes.io/*, cube.cloud.tencentcloud.com/*) — are never touched by label commands. The machine type is managed by the machine-type commands above; isolation is changed only with node isolate / node unisolate.
Add a node
Adding a compute node means installing the compute-plane components and registering Cubelet with CubeOps. There is no separate node add CLI command; registration completes automatically once the compute-node service starts.
Procedure
Copy and extract the same release bundle used by the control node.
Copy the environment template, then set the compute-node role, node IP, and control-plane address:
bashcp env.example .env ONE_CLICK_DEPLOY_ROLE=compute CUBE_SANDBOX_NODE_IP=<current-node-ip> ONE_CLICK_CONTROL_PLANE_IP=<control-plane-ip>(Optional but strongly recommended) Copy
CUBE_S3_*from the control node to this node's.env:bash# Run on the control node; paste the output into the compute node's .env grep '^CUBE_S3_' /usr/local/services/cubetoolbox/.one-click.envOr point at another shared S3-compatible store. If missing, the installer warns and continues, but the S3 volume plugin stays disabled; you'll be reminded again when install finishes.
Install the compute node:
bashsudo ./install-compute.shVerify the local services:
bashsudo ./quickcheck.shFrom the control node, confirm that the node is registered and healthy:
bashcubeopscli node listDistribute the templates required on the new node. Depending on the template state and deployment workflow, use template redo with the target node or rebuild the template.
For complete environment variables, installation behavior, scheduler configuration, and troubleshooting, see Multi-Node Cluster Deployment.
Isolate a node
Isolation temporarily prevents CubeMaster from scheduling new sandboxes onto a compute node. It is similar to Kubernetes cordon: the node may remain healthy and existing sandboxes continue running.
For an isolated node, new sandbox scheduling skips it; creation fails if no other schedulable node is available. Existing sandboxes are unaffected and are not destroyed or migrated automatically.
Isolation is not drain
Isolation does not evict existing sandboxes. Before maintenance that interrupts processes or networking, isolate the node and then explicitly destroy its sandboxes.
Isolate
# One node
cubeopscli node isolate <node_id>
# Multiple nodes
cubeopscli node isolate <node_id_1> <node_id_2>The operation is idempotent. After it succeeds, confirm that SCHEDULING_DISABLED is true:
cubeopscli node listWait at least 60 seconds for in-flight scheduling and creation windows to finish before disruptive maintenance.
For automation, use the CubeOps API with a JWT:
curl -X PUT "http://127.0.0.1:3010/api/v1/nodes/<node_id>/isolation" \
-H "Authorization: Bearer $TOKEN"Unisolate
After maintenance, allow the node to receive new sandboxes again:
cubeopscli node unisolate <node_id>Or use the API:
curl -X DELETE "http://127.0.0.1:3010/api/v1/nodes/<node_id>/isolation" \
-H "Authorization: Bearer $TOKEN"Confirm that SCHEDULING_DISABLED is false before returning the node to service.
For a Kubernetes compute-plane upgrade, follow Kubernetes Upgrade after isolating and emptying the node.
Delete a node
Deleting a node removes its registration, status, component-version metadata, and cached metrics from CubeOps. It does not stop processes, destroy sandboxes, remove disks, or delete a Kubernetes Node object.
Isolate and empty the node first
CubeOps only deletes a node that is isolated and has no sandboxes. Deletion does not isolate the node or destroy its workloads.
Recommended sequence
- Isolate the node.
- Wait at least 60 seconds for in-flight scheduling to finish.
- Destroy every sandbox on the node.
- Stop or retire Cubelet so it cannot immediately register again.
- Delete the node record.
- Confirm that the node is absent from the list.
Delete with cubeopscli
# Delete one node
cubeopscli node rm <node_id>
# `rm` is an alias for `delete`; multiple nodes are supported
cubeopscli node delete <node_id_1> <node_id_2>Batch deletion attempts every node even if an earlier node fails, then returns an error listing the failures.
If the compute node is unreachable and CubeOps cannot verify its sandbox inventory, use forced deletion:
cubeopscli node rm --force <node_id>--force bypasses only sandbox inventory verification. The node must still be isolated.
Delete with the internal API
curl -X DELETE "http://127.0.0.1:3010/internal/v1/nodes/<node_id>"
# Bypass inventory verification when the node is unreachable
curl -X DELETE "http://127.0.0.1:3010/internal/v1/nodes/<node_id>?force=true"Common failures are:
404 Not Found: the node does not exist.409 Conflict: the node is not isolated or still has sandboxes.502 Bad Gateway: CubeMaster could not verify the sandbox inventory; restore connectivity or explicitly retry with force.
Deletion is not a permanent ban. If Cubelet is still running or starts again, it can register the same node ID as a new node record.