How to expand rancher disk in Automation Suite on Linux (RKE2) to avoid resource competing on image?
Issue:
If there is no sufficient space in rancher disk, issue of resource competing on image will raise, image will get forcibly deleted and cause issues in pod pulling image or running. In that case, we can follow the steps below to expand the rancher disk.
Resolution:
Scenario 1: Adding new disk
If /dev/sdd is the new disk, execute below commands
-
new_disk="/dev/sdd"
-
pvcreate "$new_disk"
-
vgextend uipathvg "$new_disk"
-
vgdisplay uipathvg //the newly added disk space should be observed
-
Extend rancher LV using all of freespace in the extended uipathvg using - lvextend -l +100%FREE /dev/uipathvg/rancherlv or extend by a specific size using - lvextend -L +100G /dev/uipathvg/rancherlv. Ensure that there is enough free space on the uipathvg while using latter command.
-
xfs_growfs /var/lib/rancher
Scenario 2: Expand the original disk
If /dev/sdb is the disk in which the rancher LV is present and which is currently expanded
-
pvresize /dev/sdb
-
vgdisplay uipathvg //the newly added disk space should be observed
-
Execute rancher LV using all of freespace in the extended uipath vg using - lvextend -l +100%FREE /dev/uipathvg/rancherlv or extend by a specific size using - lvextend -L +100G /dev/uipathvg/rancherlv
-
xfs_growfs /var/lib/rancher
Since kubelet LV resides on same PV (Physical Volume), if there is any free space remaining on the uipathvg VG (Volume Group), it can be extended using below commands
-
lvextend -L +100G /dev/uipathvg/kubeletlv
-
xfs_growfs /var/lib/kubelet