UCloud logo UCloud logo UCloud
v2026.7.0-k8s.18
  1. UCloud/Core
  2. 1. Introduction
  3. 2. Projects
  4. 3. API Tokens
    1. 3.1. Platform API Tokens
    2. 3.2. Provider API Tokens
  5. 4. Accounting
  6. 5. Orchestration
  7. 6. Frontend
  8. UCloud/IM for Slurm-based HPC
  9. 7. Installation
  10. 8. Architecture and Networking
  11. 9. User and Project Management
  12. 10. Filesystem Integration
    1. 10.1. Inter-provider file transfers
  13. 11. Slurm Integration
    1. 11.1. Application Management
    2. 11.2. Built-in Applications
  14. 12. Reference
    1. 12.1. Configuration
    2. 12.2. CLI
  15. 13. Appendix
    1. 13.1. Built-in Application Index
  16. UCloud/IM for Kubernetes
  17. 14. Installation
  18. 15. Architecture and Networking
  19. 16. Filesystem Integration
  20. 17. Compute Jobs
    1. 17.1. Networks
    2. 17.2. Public Links
    3. 17.3. Public IPs
    4. 17.4. License Servers
    5. 17.5. SSH Servers
    6. 17.6. Job Audit Log
    7. 17.7. Virtual machines
  21. 18. AI Inference
    1. 18.1. Architecture
    2. 18.2. Chat Middleware
    3. 18.3. Chat Playground
    4. 18.4. Model Discovery and Catalog
    5. 18.5. Dynamo Deployments
    6. 18.6. Usage and Accounting
    7. 18.7. Audit
    8. 18.8. Metrics
    9. 18.9. Security
  22. 19. Integrated applications
    1. 19.1. Syncthing
    2. 19.2. Integrated terminal
    3. 19.3. Kubernetes clusters
      1. 19.3.1. Architecture
      2. 19.3.2. Stacks
      3. 19.3.3. Creating a cluster
      4. 19.3.4. Cluster dashboard
      5. 19.3.5. Networking and storage
      6. 19.3.6. Maintenance and upgrades
      7. 19.3.7. Backup and recovery
      8. 19.3.8. Reference
  23. 20. UCX applications
    1. 20.1. Hello world
    2. 20.2. Data binding
    3. 20.3. UI events
    4. 20.4. Component reference
    5. 20.5. API reference
  24. 21. Reference
    1. 21.1. Configuration
    2. 21.2. CLI
  25. Style guidelines
  26. 22. Branding and identity for UCloud
  27. 23. Documentation
  28. H: Procedures
  29. 24. H: Procedures
  30. 25. H: Introduction
  31. 26. H: Auditing
  32. 27. H: Auditing scenario
  33. 28. H: GitHub actions
  34. 29. H: Deployment
  35. 30. H: 3rd party dependencies (risk assesment)
  36. Glossary
  37. 31. Glossary
  1. Links
  2. Source Code
  3. Releases

Maintenance and upgrades

The Kubernetes cluster application is a pre-release. It is not ready for production use, and the behavior and the interfaces can change.

The application maintains the nodes in place: it moves the workloads away, restarts the node, and returns it to the cluster. Every operation is recorded in the stack KV-state before it starts, so an operation survives a restart of the process that started it.

Operation model

A maintenance operation is one record per node. The record names the kind of the operation, its phase, its deadline and its progress. The application supports these kinds:

KindPurpose
Cordon and drainStops new workloads on the node and moves the current workloads away.
CordonStops new workloads on the node.
UncordonLets the node accept workloads again. It also releases a traffic suspension.
UpgradeInstalls a new Kubernetes release on the node.
OS updateInstalls the operating-system packages of the node and reboots it when the policy asks for a reboot.
RemoveDeletes the node from the cluster and removes its infrastructure.
PhaseMeaning
PendingThe operation waits for a worker.
RunningA worker executes the operation.
CompletedThe operation finished.
BlockedThe operation waits for the operator. For example, a drain stops at a pod that it must not delete.
FailedThe operation stopped with an error.
CancelledThe operator cancelled the operation.

The maintenance coordinator runs on every control plane node. The coordinators sweep the operation records every few seconds:

  1. A coordinator finds an operation that no live worker owns. A worker owns an operation while it writes the heartbeat of the operation. A heartbeat that is older than two minutes makes the operation stale.
  2. The coordinator claims the operation with a write that names the current revision of the record. A second coordinator that loses the write skips the operation.
  3. A worker executes the operation against the Kubernetes API and, for remote work, against the node agent of the node.
  4. The worker writes the phase and the progress to the record. Every write checks the revision, so the worker stops quietly when another coordinator took the operation.
flowchart TB
    submit["Operator<br/>Maintenance page"]:::diagram-external-user
    record["Operation<br/>Stack KV-state | one record per node"]:::diagram-provider-document-text
    sweep["Coordinator<br/>Sweep and claim"]:::diagram-provider-cog-6-tooth
    worker["Worker<br/>One per operation"]:::diagram-provider-cog-6-tooth
    node["Node<br/>Kubernetes API and node agent"]:::diagram-provider-server

    submit --> record
    record --> sweep
    sweep -->|"claims stale work"| worker
    worker --> node
    worker -->|"phase and progress"| record

The path of one operation from the dashboard to a node. It does not show the guards that run before the submission, or the steps of each operation kind.

Only one operation is active per node. A new submission is rejected while an operation is active, unless the active operation is stale. The guards run before the submission:

GuardRule
ClusterThe cluster must be in the created or cleanup-pending phase.
RecoveryNo recovery operation may be active.
TimeoutThe timeout of an operation is between 30 and 3600 seconds.
Force deleteThe deletion of pods without a grace period requires bypassing the disruption budgets. It is not available for upgrades, because the application cannot prove that the workloads stopped.
RemovalThe cluster must keep at least two control plane nodes for the etcd quorum, and only one removal may run at a time.

A failed upgrade or operating-system update that reached the node marks the operation with RecoveryRequired. Until the operator retries the failed operation or uncordons the node, no other operation may start on that node. The rule keeps a node from staying cordoned with an unknown version while other maintenance proceeds.

Node agent

The node agent runs as root on every node. It is the only process that can change the software of a node. The coordinator reaches the agent on the private address of the node, on port 9444, and it authenticates every command with the maintenance token of the node.

  • The identity of the node comes from its input: the name, the private address and the role.
  • A command carries the identifier of the operation that sent it. The agent refuses a command from an older operation while an upgrade is in flight, so a restarted coordinator cannot disturb the node.
  • The agent never exits on its own during normal operation. A failed upgrade leaves its state on disk, and the operator can retry it.
  • The agent binary updates itself from the provider-delivered executable. The update happens only while the agent is idle.

Kubernetes upgrade

A Kubernetes upgrade moves one node to a new k3s release:

  • A node can move forward to another patch of the same minor release, or to the next minor release. A larger step needs intermediate upgrades or a replacement of the node.
  • The control plane nodes must stay within one minor release of each other, and a worker may not run a newer minor release than the oldest control plane node.
  • The application checks the node, the versions, the etcd quorum and the node agent before it starts.
flowchart TB
    preflight["Preflight<br/>Versions, quorum, node agent"]:::diagram-provider-magnifying-glass
    drain["Preparation<br/>Cordon + drain, suspend traffic"]:::diagram-provider-cog-6-tooth
    download["Download<br/>Prepare binary and checksum"]:::diagram-provider-code-bracket
    snapshot["Snapshot<br/>Etcd + preupgrade"]:::diagram-provider-document-text
    install["Install<br/>Stop, replace the binary, restart"]:::diagram-provider-server
    verify["Verify<br/>Check everything is healthy"]:::diagram-provider-magnifying-glass
    finish["Finish<br/>Uncordon, restore traffic"]:::diagram-provider-cog-6-tooth

    preflight --> drain
    drain --> download
    download --> snapshot
    snapshot --> install
    install --> verify
    verify --> finish

The steps of one Kubernetes upgrade. It does not show the waits between the polls of the node agent, or the retries of a failed step.

The upgrade has two stages. The coordinator performs the preflight checks and the optional cordon and drain. It then suspends the traffic of a control plane node, and it submits the remote work to the node agent: the download, the etcd snapshot, the restart of k3s, and the verification. The two stages are recorded, so an interrupted upgrade resumes at the remote stage.

After a successful upgrade, the application records the desired version on the node, releases the traffic suspension and uncordons the node. A failed upgrade leaves the operation in the Failed phase with the retry instructions in the log of the operation.

Rolling upgrade

A rolling upgrade moves every node of the cluster to one target release. The dashboard can start it, and the automatic maintenance can start it inside a maintenance window.

  • Every node must be able to reach the target release in one step. Otherwise the submission is rejected.
  • One node at a time is upgraded in each group. The control plane nodes form one group; every worker pool is a group of its own.
  • The control plane nodes upgrade first. The worker nodes upgrade after the last control plane node.
  • The coordinator of the run holds a lease. A coordinator that stops is replaced by another control plane node, and the run continues from the recorded state.
  • A failure stops the run. The failed node keeps its operation, and the operator resolves it from the maintenance page.
flowchart LR
    start["Rolling upgrade<br/>One target release"]:::diagram-provider-cog-6-tooth
    cp["Control plane<br/>One node at a time"]:::diagram-provider-server
    workers["Workers<br/>One node at a time per pool"]:::diagram-provider-server
    done["Complete<br/>Every node on the target"]:::diagram-provider-kubernetes

    start --> cp
    cp --> workers
    workers --> done

The order of a rolling upgrade: the control plane first, then the workers. It does not show the work of one node; see the figure above.

Operating-system update

An operating-system update installs the package updates of one node and restarts it when the update needs a restart. The operation stages the packages first, then the coordinator cordons and drains the node, and the node agent applies the packages.

Node agent phaseMeaning
stagingThe node refreshes its package lists and downloads the packages.
stagedThe packages wait for the restart of the node.
applyingThe node installs the packages.
rebootingThe node restarts.
verifyingThe node checks the services after the restart.

The reboot policy decides when the node restarts:

  • whenRequired restarts the node only when a pending kernel or a reboot marker asks for it.
  • always restarts the node after every update.

The node agent reports the package state of every node to the automatic maintenance state. The coordinator asks for a new report every six hours, before a window and on demand, so the dashboard can show the reports after a restart.

An operating-system update that was submitted to the node cannot be cancelled. The operator retries it, like a failed upgrade.

Node removal

A removal deletes a node from the cluster and removes its infrastructure. The operation runs in three stages:

  1. Traffic and drain. The application suspends the traffic of a control plane node first. The node drains when the operator asked for a drain. The application then deletes the Kubernetes Node object. k3s removes the member from etcd on a control plane node.
  2. Verification. The coordinator checks that the control plane still answers. A removal of a control plane node stops here when the cluster does not answer.
  3. Infrastructure. The application terminates the job of the node, releases the private address, removes the node from the cluster record, and deletes the input files of the node.

The deletion of the Node object is the point of no return. The application refuses a cancellation after that point, and the operator must retry the removal. The application also refuses a removal that would leave fewer than two control plane nodes, because the etcd quorum needs them.

Automatic maintenance

The provider and the user can schedule maintenance inside a time window. The policy holds:

SettingMeaning
WindowThe days, the start hour in UTC and the length of the window. The default window is four hours long and it starts at 02:00 UTC.
Kubernetes updatesEnables the automatic rolling upgrades and sets the oldest acceptable backup. The default is one hour.
OS updatesEnables the automatic operating-system updates and selects the reboot policy.

A run moves through these phases: pending, preflight, backup, running, and completed or blocked. The dashboard shows the checks of the run:

CheckVerifies
ClusterThe cluster is in the created or cleanup-pending phase.
RecoveryNo recovery operation is active.
Maintenance stateNo node has an active operation.
NodesEvery node is present and ready.
QuorumThe control plane survives the upgrade of one node.
Node agentsEvery node answers on the maintenance API.
Version spreadThe node versions are within the supported spread.
Upgrade pathEvery node can reach the target release in one step.
Rolling upgradeThe active rolling upgrade matches the run.
BackupA recent backup exists. A stale backup makes the run request a new backup and wait.
OS updatesThe package reports of the nodes are current.

The target release is the highest supported release that every node can reach in one step. A window runs the Kubernetes updates first, followed by the operating-system updates.

The dashboard offers these actions:

  • Run maintenance now opens a maintenance window of four hours and starts the enabled channels immediately.
  • Pause for 1, 3 or 7 days defers the weekly schedule. Resume weekly schedule clears the pause.
  • Stop blocks a waiting run. The operator resolves the problem and presses Resume automatic maintenance to allow a new run.

Traffic suspension

A control plane node that restarts must not serve the Kubernetes API. The maintenance system suspends the traffic of the node before such an operation:

  1. The coordinator writes the job of the node to the traffic record.
  2. The controller reads the record and removes the job from the members of the API service.
  3. After the operation, the maintenance system removes the entry, and the controller adds the job to the service again.

A suspension whose job no longer exists is cleared automatically, so a node that was removed during maintenance cannot block another node.

Previous Networking and storage
Next Backup and recovery