Operating a Cluster

After the cluster is healthy, use the dashboard to scale it, maintain it, upgrade it, and back it up. If the control plane is lost, the cluster can be recovered from the Kubernetes application.

As a supplement to this documentation, the tutorial videos demonstrate how to add a worker node, configure and start a rolling upgrade, create a backup, and recover a cluster. The upgrade recording disables operating-system updates and performs only a Kubernetes upgrade. The recovery recording shows recovery after the cluster loses its control plane. It restores the newest backup and replaces the control-plane node.

Scale Out

To add a worker to an existing pool:

  1. Open Cluster > Nodes in the cluster dashboard.

  2. Select the plus button at the right side of the worker pool row.

  3. Choose the disk size and the number of nodes, then select . All nodes in a pool use the same machine type.

Form for adding nodes to a worker pool
  1. Wait for the new node to show Ready in the node list.

The node appears in the same pool as the existing worker.

Two ready worker nodes in the same pool

To use a different machine type, select Add worker pool and choose the new pool's name, machine type, disk size, and node count. All nodes must use the same provider as the cluster.

A cluster can have at most 256 nodes. Each new node is a UCloud job with its own machine and disk. Scale out requires a healthy cluster. The dashboard shows the current phase otherwise.

If a failed scale-out leaves resources behind, the application removes them in the background. Scale out waits until the cleanup finishes. The dashboard shows the pending resources.

Upgrade Kubernetes

Use the maintenance page to run the enabled updates in a rolling run. The Maintenance page can be accessed from the Home cluster dashboard by selecting View next to Maintenance. A Kubernetes upgrade moves all nodes to a new release. The control plane upgrades first, one node at a time. Worker pools follow, with one node at a time in each pool by default. The dashboard shows the checks and progress.

Important

Upgrading a cluster with one control plane node temporarily interrupts the Kubernetes API and the dashboard while that node restarts. An operating-system update that restarts the only control plane node has the same effect.

Schedule automatic maintenance

  1. On the Home cluster dashboard, select View next to Maintenance.

  2. A cluster with no saved policy uses the default: Kubernetes upgrades and Operating-system updates are both selected. Select a task to turn it on or off. The policy saves immediately.

  3. Choose a day and a four-hour period in UTC. The default is Sunday, 02:00-06:00 UTC.

Maintenance policy with Kubernetes upgrades selected

The application chooses a supported target version for the nodes and performs the upgrade in the maintenance window. It checks the cluster before starting. An upgrade needs a recent backup, which is at most one hour old by default. If necessary, the application requests a new backup and waits for it.

Start an upgrade now

A rolling upgrade can start without waiting for the schedule:

  1. On the Maintenance page, select Run now.

  2. Select Run maintenance now to confirm the run.

The application chooses the next supported release for the cluster.

Confirmation dialog for a Kubernetes upgrade

A run can take several minutes. If it stops, check the reported problem on the maintenance page before retrying.

A node can upgrade to a newer patch of the same minor release, or to the next minor release. A larger step needs intermediate upgrades or a replacement 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.

Operating-system updates

Operating-system updates are enabled by default. The application drains a node before it installs the package updates. It restarts the node when an update needs a restart. A node that restarts is temporarily unavailable.

Operating-system updates can be turned on or off on the maintenance page. The same policy controls both update types.

Other node maintenance

Open Cluster > Nodes and use the actions menu for a node to cordon, drain, uncordon, upgrade, or remove it. The application blocks the removal of a control-plane node if fewer than two control-plane nodes would remain. If a drain stops at a pod, the operation waits until the problem is resolved. The dashboard shows the reason.

Back Up and Restore

The application takes a cluster backup every hour and stores it on the state drive. A cluster keeps the 48 newest hourly backups and the newest backup of each of the last 14 days. On the dashboard, select View next to Backups to see the last successful backup and the retained snapshots. Select to request an additional snapshot. This does not change the hourly schedule.

Control-plane backups page with retained snapshots

Important

The snapshots contain Kubernetes objects, not the contents of persistent volumes or other files. Keep separate backups of important data. If the state drive or the project is deleted, the cluster backups are deleted with it.

Recover a cluster

Recovery replaces the control plane nodes from a snapshot. The worker nodes keep running, and the cluster keeps its ID, worker pools, and addresses. A recovery can also start while the cluster is cleaning up after a failed scale-out. The recovery tries to remove the leftover resources first. Recovery can start even when the cluster dashboard is unavailable:

  1. Open Apps > Development > Kubernetes in the Apps Portal.

  2. Select Recover an existing cluster, choose the cluster, and select to open the recovery interface.

  3. Select a backup and choose Review recovery.

  4. Review the nodes and the warning, then press and hold to restore the snapshot.

Dialog to select a cluster for recovery
  1. Wait for the recovery checks. If a check needs attention, resolve the problem and select Check again. When the cluster is ready, select Close recovery.

Danger

Recovery restores Kubernetes objects across the entire cluster to their state at the time of the backup. Changes made after that backup are lost.

Networking and Storage

The Kubernetes API is available through a public link with a generated hostname. The kubeconfig uses this link. The Ingress controller serves application traffic. UCloud creates a public link for every Ingress host that matches the provider's public link pattern.

The cluster uses these private ranges:

Network

Range

Machines

172.31.0.0/16

Pods

10.14.0.0/16

Services

10.15.0.0/16

Persistent volumes are stored on the cluster's state drive, so they are available from every node and a pod can mount them after a move to another node. The default storage class is ucloud-storage. The state drive also holds the cluster backups.

Delete the Cluster

Select Delete cluster from the Kubernetes Home dashboard to remove the cluster and its machines.

Danger

The state drive is deleted with the cluster, including the persistent volumes and the backups. This action cannot be undone. Type the cluster ID to confirm. Copy any files that are needed before the cluster is deleted.

Troubleshooting

Symptom

Check

The cluster stays in the provisioning phase

Open the node jobs from the dashboard and read their logs. Check that the state drive exists.

The cluster enters the error phase

Read the failure reason on the dashboard home page.

The cluster stays in the cleanup-pending phase

Read the pending resources on the home page or the provisioning view. The application retries the cleanup. The listed job or reservation can also be removed manually. Maintenance, backup, and recovery stay available.

kubectl cannot connect

Check the Kubernetes API public link, the Kubernetes API service, and the kubeconfig.

An application is not reachable

Check the Ingress host, the public link, and the Ingress controller log.

A node never becomes ready

Check the node job and the Kubernetes service.

A backup does not run

Check that a control plane node is reachable.

Automatic maintenance does not run

Check the policy, the window, and the checks on the maintenance page.

For a failing node, open Cluster > Nodes, select Go to job, and read the job log. For a failing pod, open Workloads > Pods and read the container log.