This topic describes how to mount a disk to a Kubernetes cluster node. Mounting a disk allows you to expand the Docker data directory and maintain a sufficient disk capacity when the number of containers or images that run on a node increases.
Your Kubernetes cluster version must be v1.10.4 or later.
- If no disk is mounted to the existing node, see Mount a disk to the Docker data directory.
- If you have created a disk for the existing node, but you have failed to mount the disk to the node, you can follow these steps.
- We recommend that you create a snapshot of the target node or back up node data to avoid data loss.
- Additionally, you must ensure that you can schedule your cluster applications to other nodes.
- We recommend that you perform this operation during off-peak service hours to avoid disruptions to your business.
- Draining a node reschedules pods on the node to other nodes. Therefore, you must ensure that your Kubernetes cluster has sufficient nodes. We recommend that you add cluster nodes in advance as needed.
/var/lib/dockerhas been mounted to
/dev/vdb1. If the disk mounting operation failed, you can mount the disk by following these steps.
- Set the target node as unschedulable. For more information, see Mark node as unschedulable.
- Drain the target node. For more information, see Safely drain a node.
- Remove the target node. This topic uses the Container Service console as an example.
- Log on to the Container Service console.
- In the left-side navigation pane, click Node.
- Select the target node, and click Remove or choose .
- In the displayed Remove Node dialog box, click OK.
Note We recommend that you do not select the Release ECS at the same time check box. Otherwise, the ECS instance used by the target node will be released.
- Add the removed node to the cluster.
- In the left-side navigation pane, click Clusters.
- On the right of the target cluster, choose
- Select Automatically Add or Manually Add. In this example, the instance is added automatically.
- Select the existing instance and then click Next Step.
- Turn on the Format Data Disk switch.
- Complete other required settings.
After the node has been added to the cluster, you can log on to the node to run the df command to check whether a disk has been mounted to the target node.