Cluster upgrade flow
The cluster upgrade flow evolves an installed Kubernetes cluster and its storage services to the versions selected in the new installer specification. It prepares assets, checks that the change is safe, applies supported version steps across all nodes, and runs data migrations when a change in storage layout needs it. It is part of the cluster installer lifecycle and shares host preparation patterns with installation bootstrap and node joining.
Upgrade orchestration
The upgrade is a staged run that starts on the local primary and coordinates work on the rest of the cluster. The flow reads the installed cluster state, merges the requested settings, runs shared host checks, prepares host dependencies and add-on assets, then runs component updates before it restores the normal cluster services.
The same installer entry point can handle a new install or an upgrade. An existing Kubernetes version causes the install path to run upgrade checks, including the upgrade form of host and in-cluster preflights. The stand-alone upgrade script follows the same main stages for an already installed cluster and runs host preflights with upgrade context. The join path uses the current settings when a node is added, but it does not perform the cluster-wide Kubernetes version walk.
The main stages are:
- Discover the installed versions and cluster roles.
- Run host and cluster checks. Ask for confirmation when a component needs an upgrade.
- Fetch or load the assets for every required version step.
- Upgrade storage services that must move first.
- Upgrade Kubernetes one supported minor-version step at a time.
- Re-apply the selected add-ons and host services.
- Run post-upgrade storage migrations and return the cluster to normal operation.
This diagram shows how the installer turns a target specification into a ready cluster while keeping storage and control-plane changes in a safe order.
flowchart TD
A[Installed cluster and target specification] --> B[Discover versions and roles]
B --> C[Shared host and cluster preflights]
C --> D[Fetch or load versioned assets]
D --> E[Upgrade Rook when required]
E --> F[Prepare Kubernetes and add-ons]
F --> G[Upgrade local primary]
G --> H[Upgrade remote primaries]
H --> I[Upgrade worker nodes]
I --> J[Install or refresh selected components]
J --> K[Run storage migrations when eligible]
K --> L[Healthy upgraded cluster]
References: scripts/install.sh• L600-626 scripts/upgrade.sh• L130-147 scripts/join.sh• L171-200 scripts/…/preflights.sh• L2-30
Version transition
The version transition uses an ordered set of supported steps instead of jumping directly between arbitrary releases. The lowest Kubernetes version found on any node becomes the starting point, so a partially upgraded cluster resumes from the oldest node that still needs work.
For each step, the flow loads the matching images and host packages, upgrades the local primary, waits for the cluster to become ready, and then asks remote primaries and workers to run the upgrade script. A node that already meets the target is skipped. After each step, the flow checks node readiness before moving to the next version.
The Kubernetes upgrade order is:
- Local primary.
- Remote primary nodes.
- Worker nodes.
Rook follows its own supported transition list. Large gaps use the intermediate Rook releases that provide the needed migration path. The early transition to Rook 1.4 uses a dedicated compatibility upgrade before later Rook versions are applied.
References: scripts/…/upgrade.sh• L40-72 scripts/…/upgrade.sh• L91-147 scripts/…/upgrade.sh• L404-546 scripts/…/rook-upgrade.sh• L133-214
Safety gates
Safety gates prevent an upgrade from starting when the cluster cannot support the requested transition. They cover version support, disk space, required assets, component health, host readiness, in-cluster readiness, and user approval.
The shared preflight stage checks the host architecture and operating system, target Kubernetes and container runtime compatibility, swap, firewall and security settings, container runtime prerequisites, reachable name servers, and automated storage-scaling prerequisites. It runs on the nodes used by install, join, and upgrade flows. On the installer upgrade path, the same stage runs in-cluster checks and validates that the selected storage and object-store changes have a supported path. The stand-alone upgrade runs the host checks with upgrade context.
The supported host and version rules include target Kubernetes limits for some operating systems and container runtime requirements for specific platform and Kubernetes combinations. The preflight stage also rejects storage-scaling settings when the selected storage versions or node count cannot support them. These checks keep an upgrade from entering a component transition that the host or storage system cannot complete.
Host or in-cluster preflight failures stop the run. Warnings can require operator approval, while the explicit preflight-ignore option records the warnings and allows the run to continue. The installer path also refuses to use a kURL release older than the one previously applied, and it rejects unsupported storage-scaling version combinations before the upgrade work begins.
The flow checks the lowest node version across local and remote nodes. It rejects unsupported major-version changes and requires the assets for each intermediate step. Online runs fetch these assets. Air-gapped runs use local packages and can ask remote nodes to load missing assets before the cluster-wide change begins.
Storage checks reserve space for downloaded archives, extracted files, and container images. The Rook path also warns when the cluster may need blank block devices. A Rook upgrade and a Kubernetes upgrade can each stop the run before any destructive stage if the user does not confirm or if the space check fails.
References: scripts/…/preflights.sh• L2-30 scripts/…/preflights.sh• L109-117 scripts/…/preflights.sh• L344-350 scripts/…/preflights.sh• L578-783 scripts/…/preflights.sh• L908-950 scripts/…/upgrade.sh• L138-146 scripts/…/upgrade.sh• L155-206 scripts/…/upgrade.sh• L209-325 scripts/…/rook-upgrade.sh• L5-24 scripts/…/rook-upgrade.sh• L89-115 scripts/…/rook-upgrade.sh• L328-365
Storage migrations
Storage migration changes where cluster data lives so later component versions can use the required storage model. The flow treats these operations as separate guarded stages because they can move or stop application data.
Rook OSD migration
The Rook OSD migration changes directory-based object storage daemons to block-device storage before a Rook upgrade that needs the newer layout. It first confirms that Rook is healthy, enables block devices, waits for enough block-based OSDs, and then removes old OSDs one at a time.
Each old OSD is reweighted to zero so Ceph can move its data. The flow waits for health and data movement, scales the old OSD down, waits for it to leave the cluster, and purges it only after the data is safe on the new devices.
References: pkg/…/migrate.go• L19-85 pkg/…/migrate.go• L88-109 pkg/…/migrate.go• L164-219 pkg/…/rook_hostpath_to_block.go• L9-22
OpenEBS to Rook migration
The multi-node storage migration moves persistent volumes from OpenEBS to Rook when both systems are selected and the cluster has enough nodes for distributed storage. The installer checks that the migration is available through the EKCO operator, explains the expected application downtime, and lets the operator defer the change.
After approval, the migration command waits for EKCO and the cluster to report readiness. It then starts the migration through EKCO and polls until the operator reports completion. A failed or timed-out migration returns its logs and leaves the installer able to continue, so the migration can be retried later with the cluster task command.
References: scripts/…/rook.sh• L528-587 pkg/…/cluster_migrate_multinode_storage.go• L204-273 pkg/…/cluster_migrate_multinode_storage.go• L276-302
Storage class migration
The storage class migration moves persistent volume data between supported provisioners when the selected cluster storage changes. It warns that applications using the source volumes will stop and checks the source and destination systems before it starts.
The migration records completion in the cluster so later installer runs can decide whether the old Rook system is safe to remove. Rook is removed only after both persistent volumes and object-store data are marked as migrated. If object-store data is not covered, the flow keeps Rook in place rather than risk data loss.
References: scripts/tasks.sh• L661-737 scripts/…/rook.sh• L199-300 scripts/…/rook.sh• L302-351 scripts/…/rook.sh• L506-526
Component updates
Component updates re-apply the selected add-ons around the Kubernetes change. An add-on is a cluster service or host service selected by the installer, such as the container runtime, network plug-in, storage system, or management service.
The update path fetches the requested add-on package, loads its images, and runs its lifecycle stages in the order required by the installer. Host components can join the node preparation stage. Cluster components run during install and post-init stages after Kubernetes is ready. This lets an upgrade refresh component versions without treating every add-on as part of the Kubernetes version walk.
Rook is a special case. Its operator is paused while Rook or Kubernetes changes are applied, then enabled after the transition. EKCO is also paused during Rook changes because it can otherwise restore or change resources while the storage system is being updated.
References: scripts/…/distro.sh• L35-64 scripts/…/addon.sh• L4-42 scripts/…/addon.sh• L44-79 scripts/…/addon.sh• L105-115 scripts/…/rook.sh• L3-21 scripts/…/rook.sh• L53-71
Recovery state
The upgrade is safe to re-enter because each version step checks the version already reported by a node before it acts. A node that completed a step is skipped on a later run, while the lowest remaining version still drives the cluster-wide transition.
The flow writes a time-stamped log for each install, join, upgrade, or task run. It also reports component start, success, and failure states. Host and in-cluster preflight results are saved with the run context for support review. Storage migration status is kept in cluster state, which prevents automatic Rook removal until all required data migrations have completed.
References: scripts/…/upgrade.sh• L404-459 scripts/…/upgrade.sh• L485-546 scripts/upgrade.sh• L164-171 scripts/…/preflights.sh• L785-808 scripts/…/rook.sh• L302-351
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the supported Kubernetes step list aligned with asset fetching, disk estimates, and the commands run on local and remote nodes.
- Keep the Rook step list aligned with the special 1.0-to-1.4 path, package loading, and the add-on version used during each step.
- Keep remote-node upgrade commands aligned with the flags needed for air-gapped runs, proxy settings, install paths, and node discovery.
- Keep migration readiness, approval, status, and log endpoints aligned between the cluster command and EKCO.
- Keep the migration status keys aligned with the condition that permits automatic Rook removal.
- Keep add-on ordering aligned with host preparation, Kubernetes readiness, component install, and post-init behavior.
- Keep shared preflight scope, target-version rules, storage-scaling checks, and upgrade flags aligned between the installer upgrade path and the stand-alone upgrade entry point.
- Keep preflight warning and ignore behavior aligned with the exit codes and saved result files consumed by support workflows.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A required intermediate Kubernetes or Rook asset is missing | The version walk stops before that step | Fetch or load all step assets and check them before the upgrade starts |
| A node has an unsupported major version or remains below the target after its step | The cluster cannot complete the version transition | Compare node versions and wait for the target version and node readiness |
| A host or in-cluster preflight reports a blocking failure | The upgrade stops before component changes begin | Resolve the reported condition or use the documented preflight override only with operator approval |
| The target Kubernetes or container runtime version is not supported by the host platform | The upgrade is blocked before the runtime or Kubernetes change | Use a supported platform and version combination |
| The selected installer release is older than the previously applied kURL release | The installer path refuses to update the cluster | Use a kURL release equal to or newer than the recorded release |
| The selected storage versions do not support automated scaling or the requested minimum node count | The preflight blocks the upgrade before storage changes | Use supported storage versions and a supported node count |
| The cluster lacks disk space for upgrade archives, extracted files, or images | The upgrade can fail during asset load or component update | Run the component-specific storage check before proceeding |
| Rook is unhealthy or has too few block OSDs during OSD migration | Data movement stops and the old OSD is not purged | Require health, wait for the block OSD count, and wait for health after each removal |
| A storage migration is approved while applications use the source volumes | Applications stop and the migration can fail or cause data loss | Warn about downtime, validate the provisioners, and recommend a backup before approval |
| PVC data is migrated but object-store data is not | Automatic Rook removal is blocked | Record both migration results and remove Rook only when both are complete |
Key files
| File | Why to read it |
|---|---|
| scripts/install.sh | Main installer order for preflight, component update, Kubernetes upgrade, and post-upgrade migration |
| scripts/upgrade.sh | Stand-alone upgrade entry point and local node preparation |
| scripts/…/preflights.sh | Shared host and cluster gates, platform and runtime compatibility, storage-scaling checks, migration eligibility checks, warning handling, and saved preflight results |
| scripts/…/upgrade.sh | Kubernetes version stepping, asset handling, node order, and readiness waits |
| scripts/…/rook-upgrade.sh | Rook version stepping, storage checks, image handling, and operator control |
| scripts/…/rook.sh | Storage migration gates, migration status, and Rook cleanup rules |
| pkg/…/migrate.go | Rook directory-to-block storage safety sequence |
| pkg/…/cluster_migrate_multinode_storage.go | EKCO-backed multi-node storage migration contract and status polling |
| scripts/…/addon.sh | Add-on lifecycle stages used to refresh selected components |
| scripts/…/distro.sh | Component order used by the kubeadm-based cluster flow |