How-torke2spray

Operate the cluster lifecycle

Check health, scale, upgrade, snapshot, recover, and remove nodes from an RKE2 cluster.

Updated Verified SourceEdit this page

Core summary

  • Every change begins with an Inventory review, Vault check, preflight, and current health check.
  • Add workers through scale.yml and add servers one at a time through cluster.yml.
  • Upgrades sequence cordon, drain, release replacement, readiness verification, and uncordon.
  • Recovery and removal require topology-specific prerequisites and exact confirmation.
  • Do not treat CNI or cluster-CIDR changes as ordinary convergence of an existing cluster.

Follow the common execution sequence

  1. Review Inventory and inline Vault diffs

  2. Validate local Vault structure and remote topology

    make inventory-vault-check
    make inventory-preflight
  3. Preserve the current cluster state

    make cluster-health
  4. Confirm targets and scope, then run the lifecycle

  5. Verify completion with the same health checks

Select the operation entrypoint

TaskPlaybook or targetRKE2 behavior
Install or reconvergecluster.yml / make cluster-convergeConfigure servers and agents, then verify readiness
Add workerscale.yml --limit=<worker>Converge only the selected agent batch
Add servercluster.yml --limit=<server>Join one server at a time
Upgradeupgrade-cluster.yml / make cluster-upgradeSequential drain and release replacement
Healthmake cluster-healthRead-only service, API, Node, and etcd checks
Snapshotmake cluster-snapshotCreate an RKE2 embedded-etcd snapshot
Recoveryrecover-control-plane.ymlRecover embedded etcd from a selected snapshot
Remove noderemove-node.ymlDrain, verify membership, and uninstall RKE2
Reset allreset.ymlStop services and run the official uninstaller

Compare Kubespray and rke2spray operations

Operation or scenarioKubespray baseline behaviorrke2spray behaviorCompatibility
cluster.ymlPrepares hosts and the container runtime, installs etcd, runs kubeadm, installs the CNI, and applies cluster appsConfigures checksum-locked RKE2 servers and agents, uses bundled containerd, joins embedded-etcd members, and verifies services, the API, and NodesAdapter
scale.ymlAdds Inventory-selected Kubernetes nodes through the Kubespray node lifecycleAdds only selected kube_node workers as RKE2 agents; servers continue to use cluster.ymlAdapter
upgrade-cluster.ymlUpgrades kubeadm-managed Kubernetes components and the selected runtime lifecycleReplaces the checksum-locked RKE2 release one server at a time and agents in bounded batchesAdapter
remove-node.yml with a reachable nodeDrains the Node, removes an etcd member when applicable, and resets the target hostDrains the Node, verifies the exact embedded-etcd member, deletes the Node, and runs the official RKE2 uninstallerAdapter
remove-node.yml with an unreachable serverCannot complete the target-host reset; the operator must move to control-plane recovery or repair host accessDoes not pretend that target-host cleanup succeeded; use recover-control-plane.yml with the server fenced and removed from load balancer backendsExplicit recovery boundary
recover-control-plane.yml with quorum retainedFor non-kubeadm etcd, checks endpoint health, removes broken members, and reruns cluster.ymlVerifies exact peer membership, quorum, and learner absence; creates a protected snapshot, removes the exact dead member from a survivor, and joins the replacement through cluster.ymlSafety-expanded adapter
recover-control-plane.yml after quorum lossFor non-kubeadm etcd, creates or accepts a snapshot, restores one etcd member, and reruns cluster.ymlValidates snapshot ownership, mode, and checksum; performs RKE2 cluster-reset, rejoins installed servers, and converges clean replacements through cluster.ymlRKE2 restore adapter
reset.ymlRuns the Kubespray reset lifecycle for kubeadm, services, networking, and the selected runtimeStops RKE2 services and runs the official RKE2 uninstallerAdapter
Health and snapshot helpersNo equivalent stable root Playbook API in this compatibility contractKeeps read-only health checks and RKE2 snapshot creation under extra_playbooks/ and Make targetsKubespray extension point

Compatibility scope

The shared Playbook name preserves the public operational intent, not the kubeadm task implementation. Consult Compatibility before assuming that an upstream variable or internal Role has an RKE2 equivalent.

Enforce destructive-operation boundaries

  • Remove only one server at a time and leave at least two servers.
  • Do not remove the bootstrap server without a separate lifecycle-identity review.
  • With an external load balancer, first remove the server from the 80, 443, 6443, and 9345 backends.
  • Do not use recover-control-plane.yml for an external datastore.
  • Never bypass confirmations for reset, remove, recover, or AddOn pruning.

Operational boundary

Off-host snapshot copies and long-term retention belong to a separate backup system; creating a local snapshot alone does not complete disaster recovery.

Conclusion

  • Preserve evidence from checks before and after each change instead of treating the command as the whole operation.
  • When a prerequisite is unclear, check Compatibility first.