Updated on 2026-03-23 GMT+08:00

Expanding the Storage Capacity

The capacity of types of storage that can be expanded for CCE nodes is listed in the table below.

Table 1 Storage capacity expansion methods

Type

Name

Purpose

Capacity Expansion Method

Node disk

System disk

A disk attached to a node for installing the operating system

Expanding the System Disk Capacity

Data disk

The first data disk attached to a node for container runtime and kubelet

Container storage

Pod container space

The base size of a container, which issue the upper limit of the disk space occupied by each pod (including the storage space occupied by container images)

Expanding the Capacity of a Data Disk Used by Pods (basesize)

PVC

Storage resources mounted to the containers

Expanding the PVC Capacity

Expanding the System Disk Capacity

EulerOS 2.9 is used as the sample OS. There is only one partition (/dev/vda1) with a capacity of 50 GiB in the system disk /dev/vda, and then 50 GiB is added to the system disk. In this example, the additional 50 GiB is allocated to the existing /dev/vda1 partition.

  1. Expand the system disk capacity on the EVS console.

    Only the storage capacity of the EVS disk is expanded. You also need to perform the following operations to expand the partition and file system capacity.

  2. Log in to the node and run the growpart command to check whether growpart has been installed.

    If the tool operation guide is displayed, the growpart has been installed. Otherwise, run the following command to install growpart:

    yum install cloud-utils-growpart

  3. View the total capacity of the system disk /dev/vda.

    fdisk -l

    If information similar to the following is displayed, the total capacity of /dev/vda is 100 GiB.

    [root@test-48162 ~]# fdisk -l
    Disk /dev/vda: 100 GiB, 107374182400 bytes, 209715200 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x78d88f0b
    
    Device     Boot Start       End   Sectors Size Id Type
    /dev/vda1  *     2048 104857566 104855519  50G 83 Linux
    
    Disk /dev/vdb: 100 GiB, 107374182400 bytes, 209715200 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    Disk /dev/mapper/vgpaas-dockersys: 90 GiB, 96632569856 bytes, 188735488 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    Disk /dev/mapper/vgpaas-kubernetes: 10 GiB, 10733223936 bytes, 20963328 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes

  4. Check the capacity of the system disk partition /dev/vda1.

    df -TH

    Information similar to the following is displayed:

    [root@test-48162 ~]# df -TH
    Filesystem                    Type      Size  Used Avail Use% Mounted on
    devtmpfs                      devtmpfs  1.8G     0  1.8G   0% /dev
    tmpfs                         tmpfs     1.8G     0  1.8G   0% /dev/shm
    tmpfs                         tmpfs     1.8G   13M  1.8G   1% /run
    tmpfs                         tmpfs     1.8G     0  1.8G   0% /sys/fs/cgroup
    /dev/vda1                     ext4      53G  3.3G   47G   7% /
    tmpfs                         tmpfs     1.8G   75M  1.8G   5% /tmp
    /dev/mapper/vgpaas-dockersys  ext4       95G  1.3G   89G   2% /var/lib/docker
    /dev/mapper/vgpaas-kubernetes ext4       11G   39M   10G   1% /mnt/paas/kubernetes/kubelet
    ...

  5. Extend the partition capacity using growpart.

    growpart <system disk> <partition number>

    The partition number is 1 because there is only one /dev/vda1 partition in the system disk, as shown in the following command:

    growpart /dev/vda 1

    Information similar to the following is displayed:

    CHANGED: partition=1 start=2048 old: size=104855519 end=104857567 new: size=209713119 end=209715167

  6. Extend the file system capacity.

    resize2fs Disk partition

    An example command is as follows:

    resize2fs /dev/vda1

    Information similar to the following is displayed:

    resize2fs 1.45.6 (20-Mar-2020)
    Filesystem at /dev/vda1 is mounted on /; on-line resizing required
    old_desc_blocks = 7, new_desc_blocks = 13
    The filesystem on /dev/vda1 is now 26214139 (4k) blocks long.

  7. View the new capacity of the /dev/vda1 partition.

    df -TH

    Information similar to the following is displayed:

    [root@test-48162 ~]# df -TH
    Filesystem                    Type      Size  Used Avail Use% Mounted on
    devtmpfs                      devtmpfs  1.8G     0  1.8G   0% /dev
    tmpfs                         tmpfs     1.8G     0  1.8G   0% /dev/shm
    tmpfs                         tmpfs     1.8G   13M  1.8G   1% /run
    tmpfs                         tmpfs     1.8G     0  1.8G   0% /sys/fs/cgroup
    /dev/vda1                     ext4     106G  3.3G   98G   4% /
    tmpfs                         tmpfs     1.8G   75M  1.8G   5% /tmp
    /dev/mapper/vgpaas-dockersys  ext4       95G  1.3G   89G   2% /var/lib/docker
    /dev/mapper/vgpaas-kubernetes ext4       11G   39M   10G   1% /mnt/paas/kubernetes/kubelet
    ...

  8. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Nodes. In the right pane, click the Nodes tab, locate the row containing the node, and choose More > Sync Server Data in the Operation column.

Expanding the Data Disk Capacity

The first data disk of a CCE node is composed of container runtime and kubelet space by default. If either of them reaches full capacity, you can expand the disk capacity as needed.

In clusters of v1.21.10-r0, v1.23.8-r0, v1.25.3-r0, and later, CCE enables container runtime (Docker/containerd) and kubelet to share the capacity of the first data disk. If the shared disk capacity is insufficient, you can expand it.

The available container runtime capacity affects image pulls and container startup and running. This section uses containerd as an example to describe how to expand the container runtime capacity.

  1. Expand the capacity of a data disk on the EVS console.

    Only the storage capacity of EVS disks can be expanded. You need to perform the following operations to expand the capacity of logical volumes and file systems.

  2. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Nodes. In the right pane, click the Nodes tab, locate the row containing the node, and choose More > Sync Server Data in the Operation column.
  3. Log in to the node.
  4. Run lsblk to view the block device information of the node.

    A data disk is divided depending on the container storage Rootfs:

    Overlayfs: No independent thin pool is allocated. Image data is stored in dockersys.

    1. Check the disk and partition capacity of the device.
      # lsblk
      NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
      sda                   8:0    0   50G  0 disk 
      └─sda1                8:1    0   50G  0 part /
      sdb                   8:16   0  150G  0 disk      # The data disk has been expanded to 150 GiB, but 50 GiB space is free.
      ├─vgpaas-dockersys  253:0    0   90G  0 lvm  /var/lib/containerd
      └─vgpaas-kubernetes 253:1    0   10G  0 lvm  /mnt/paas/kubernetes/kubelet
    2. Expand the disk capacity.

      Add the new disk capacity to the dockersys logical volume used by the container runtime.

      1. Expand the PV capacity so that LVM can identify the new EVS capacity. /dev/sdb specifies the physical volume where dockersys is located.
        pvresize /dev/sdb

        Information similar to the following is displayed:

        Physical volume "/dev/sdb" changed
        1 physical volume(s) resized or updated / 0 physical volume(s) not resized
      2. Expand 100% of the free capacity to the logical volume. vgpaas/dockersys specifies the logical volume used by the container runtime.
        lvextend -l+100%FREE -n vgpaas/dockersys

        Information similar to the following is displayed:

        Size of logical volume vgpaas/dockersys changed from <90.00 GiB (23039 extents) to 140.00 GiB (35840 extents).
        Logical volume vgpaas/dockersys successfully resized.
      3. Adjust the capacity of the file system. /dev/vgpaas/dockersys specifies the file system path of the container runtime.
        resize2fs /dev/vgpaas/dockersys

        Information similar to the following is displayed:

        Filesystem at /dev/vgpaas/dockersys is mounted on /var/lib/containerd; on-line resizing required
        old_desc_blocks = 12, new_desc_blocks = 18
        The filesystem on /dev/vgpaas/dockersys is now 36700160 blocks long.
    3. Check whether the capacity has been expanded.
      # lsblk
      NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
      sda                   8:0    0   50G  0 disk 
      └─sda1                8:1    0   50G  0 part /
      sdb                   8:16   0  150G  0 disk
      ├─vgpaas-dockersys  253:0    0   140G  0 lvm  /var/lib/containerd
      └─vgpaas-kubernetes 253:1    0   10G  0 lvm  /mnt/paas/kubernetes/kubelet

The kubelet storage is temporary for kubelet components and emptyDir volumes. You can follow the following steps to increase the kubelet capacity:

  1. Expand the capacity of a data disk on the EVS console.

    Only the storage capacity of EVS disks can be expanded. You need to perform the following operations to expand the capacity of logical volumes and file systems.

  2. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Nodes. In the right pane, click the Nodes tab, locate the row containing the node, and choose More > Sync Server Data in the Operation column.
  3. Log in to the node.
  4. Run lsblk to view the block device information of the node.

    # lsblk
    NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda                   8:0    0   50G  0 disk 
    └─sda1                8:1    0   50G  0 part /
    sdb                   8:16   0  200G  0 disk       # The data disk has been expanded to 200 GiB, but 50-GiB space is not allocated.
    ├─vgpaas-dockersys  253:0    0  140G  0 lvm  /var/lib/containerd
    └─vgpaas-kubernetes 253:1    0   10G  0 lvm  /mnt/paas/kubernetes/kubelet

  5. Perform the following operations on the node to add the new disk capacity to the kubelet space:

    1. Expand the PV capacity so that LVM can identify the new EVS capacity. /dev/sdb specifies the physical volume on which kubelet is located.
      pvresize /dev/sdb

      Information similar to the following is displayed:

      Physical volume "/dev/sdb" changed
      1 physical volume(s) resized or updated / 0 physical volume(s) not resized
    2. Expand 100% of the free capacity to the logical volume. vgpaas/kubernetes specifies the logical volume used by kubelet.
      lvextend -l+100%FREE -n vgpaas/kubernetes

      Information similar to the following is displayed:

      Size of logical volume vgpaas/kubernetes changed from <10.00 GiB (2559 extents) to <60.00 GiB (15359 extents).
      Logical volume vgpaas/kubernetes successfully resized.
    3. Adjust the capacity of the file system. /dev/vgpaas/kubernetes specifies the file system path of the container runtime.
      resize2fs /dev/vgpaas/kubernetes

      Information similar to the following is displayed:

      Filesystem at /dev/vgpaas/kubernetes is mounted on /mnt/paas/kubernetes/kubelet; on-line resizing required
      old_desc_blocks = 2, new_desc_blocks = 8
      The filesystem on /dev/vgpaas/kubernetes is now 15727616 blocks long.

  6. Run lsblk to view the block device information of the node.

    # lsblk
    NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda                   8:0    0   50G  0 disk 
    └─sda1                8:1    0   50G  0 part /
    sdb                   8:16   0  200G  0 disk   
    ├─vgpaas-dockersys  253:0    0  140G  0 lvm  /var/lib/containerd
    └─vgpaas-kubernetes 253:1    0   60G  0 lvm  /mnt/paas/kubernetes/kubelet  # Allocate the new disk to the kubelet space.

Expanding the Capacity of a Data Disk Used by Pods (basesize)

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. Choose Nodes from the navigation pane.
  3. Click the Nodes tab, locate the row containing the target node, and choose More > Reset Node in the Operation column.

    Resetting a node may make the node-specific resources (such as local storage and workloads scheduled to this node) unavailable. Exercise caution when performing this operation to avoid impact on running services.

  4. Reconfigure node parameters.

    If you need to adjust the container storage space, pay attention to the following configurations:

    Storage Settings: Click Expand next to the data disk to configure the following parameter:

    Space Allocation for Pods: indicates the base size of a pod. It is the maximum size that a workload's pods (including the container images) can grow to in the disk space. Proper settings can prevent pods from taking all the disk space available and avoid service exceptions. It is recommended that the value is less than or equal to 80% of the container runtime space. This parameter is related to the node OS and container storage rootfs and is not supported in some scenarios.

  5. After the node is reset, log in to the node and check whether the container capacity has been expanded. The command output varies with the container storage rootfs.

    • Overlayfs: No independent thin pool is allocated. Image data is stored in dockersys. Run the following command to check whether the container capacity has been expanded:
      kubectl exec -it pod_name -- /bin/sh
      df -h

      If the information similar to the following is displayed, the overlay capacity has been expanded from 10 GiB to 15 GiB.

      Filesystem                    Size   Used   Avail   Use%   Mounted on
      overlay                        15G   104K     15G     1%   /
      tmpfs                          64M      0     64M     0%   /dev
      tmpfs                         3.6G      0    3.6G     0%   /sys/fs/cgroup
      /dev/mapper/vgpaas-share       98G   4.0G     89G     5%   /etc/hosts
      ...
    • Device Mapper: A thin pool is allocated to store image data. Run the following command to check whether the container capacity has been expanded:
      kubectl exec -it pod_name -- /bin/sh
      df -h

      If the information similar to the following is displayed, the thin pool capacity has been expanded from 10 GiB to 15 GiB.

      Filesystem                            Size   Used   Avail   Use%   Mounted on
      /dev/mapper/vgpaas-thinpool-snap-84    15G   232M     15G     2%   /
      tmpfs                                  64M      0     64M     0%   /dev
      tmpfs                                 3.6G      0    3.6G     0%   /sys/fs/cgroup
      /dev/mapper/vgpaas-kubernetes          11G    41M     11G     1%   /etc/hosts
      /dev/mapper/vgpaas-dockersys           20G   1.1G     18G     6%   /etc/hostname
      ...

Expanding the PVC Capacity

Cloud storage:

  • EVS:
    • You can expand the capacity of an automatically created pay-per-use volume on the CCE console. The procedure is as follows:
      1. Choose Storage in the navigation pane. In the right pane, click the PVCs tab. Locate the target PVC and choose More > Scale-out in the Operation column.
      2. Enter the capacity to be added and click OK.
  • SFS Turbo:
    • If the underlying SFS Turbo file systems are billed on the pay-per-use basis, you can expand their capacity on the CCE console.
    • If the underlying SFS Turbo file systems are billed on the yearly/monthly basis, you can expand their capacity on the SFS Turbo console first and then adjust them in the PVCs on the CCE console.
  • Local PV: Before expanding the capacity of a local PV, check the available capacity of the storage pool for the node where the PVC is located. If the expanded capacity of the local PV is less than or equal to the available capacity of the storage pool, directly adjust the PVC capacity. Otherwise, expand the storage pool and then change the capacity of the PVC.