The storage classes that can be expanded for CCE nodes are as follows:
Type |
Name |
Purpose |
Capacity Expansion Method |
---|---|---|---|
Node disk |
System disk |
A disk attached to a node for installing the operating system |
|
Data disk |
The first data disk attached to a node for container engine and kubelet |
||
Container storage |
Pod container space |
The base size of a container, which is, 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 Pod (basesize) |
PVC |
Storage resources mounted to the containers |
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.
Only the storage capacity of the EVS disk is expanded. You also need to perform the following steps to expand the partition and file system.
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
fdisk -l
If the following information 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
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 ...
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
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.
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 ...
The first data disk of a CCE node is composed of container engine and kubelet space by default. If either of them reaches full capacity, you can expand the disk space as needed.
The available container engine space affects image pulls and container startup and running. This section uses containerd as an example to describe how to expand the container engine capacity.
Only the storage capacity of the EVS disk is expanded. You also need to perform the following steps to expand the capacity of the logical volume and file system.
A data disk is divided depending on the container storage Rootfs:
Overlayfs: No independent thin pool is allocated. Image data is stored in dockersys.
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 8:0 0 50G 0 disk └─vda1 8:1 0 50G 0 part / vdb 8:16 0 200G 0 disk # Data disk has been expanded but not allocated ├─vgpaas-dockersys 253:0 0 90G 0 lvm /var/lib/containerd # Space used by the container engine └─vgpaas-kubernetes 253:1 0 10G 0 lvm /mnt/paas/kubernetes/kubelet # Space used by Kubernetes
Add the new disk capacity to the dockersys logical volume used by the container engine.
pvresize /dev/vdb
Information similar to the following is displayed:
Physical volume "/dev/vdb" changed 1 physical volume(s) resized or updated / 0 physical volume(s) not resized
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 <190.00 GiB (48639 extents). Logical volume vgpaas/dockersys successfully resized.
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 = 24 The filesystem on /dev/vgpaas/dockersys is now 49807360 (4k) blocks long.
The kubelet space serves as a temporary storage location for kubelet components and EmptyDir. You can follow the following steps to increase the kubelet capacity:
Only the storage capacity of the EVS disk is expanded. You also need to perform the following steps to expand the capacity of the logical volume and file system.
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 8:0 0 50G 0 disk └─vda1 8:1 0 50G 0 part / vdb 8:16 0 200G 0 disk # Data disk has been expanded but not allocated ├─vgpaas-dockersys 253:0 0 90G 0 lvm /var/lib/containerd # Space used by the container engine └─vgpaas-kubernetes 253:1 0 10G 0 lvm /mnt/paas/kubernetes/kubelet # Space used by Kubernetes
pvresize /dev/vdb
Information similar to the following is displayed:
Physical volume "/dev/vdb" changed 1 physical volume(s) resized or updated / 0 physical volume(s) not resized
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 <110.00 GiB (28159 extents). Logical volume vgpaas/kubernetes successfully resized.
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 = 14 The filesystem on /dev/vgpaas/kubernetes is now 28834816 (4k) blocks long.
Resetting a node may make unavailable the node-specific resources (such as local storage and workloads scheduled to this node). Exercise caution when performing this operation to avoid impact on running services.
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 set the following parameters:
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 engine space. This parameter is related to the node OS and container storage rootfs and is not supported in some scenarios. For details, see Data Disk Space Allocation.
docker exec -it container_id /bin/sh or kubectl exec -it container_id /bin/sh
df -h
Cloud storage: