How To Expand Rancher Disk in Automation Suite

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

  1. new_disk="/dev/sdd"

  2. pvcreate "$new_disk"

  3. vgextend uipathvg "$new_disk"

  4. vgdisplay uipathvg //the newly added disk space should be observed

  5. 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.

  6. 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

  1. pvresize /dev/sdb

  2. vgdisplay uipathvg //the newly added disk space should be observed

  3. 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

  4. 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

  1. lvextend -L +100G /dev/uipathvg/kubeletlv

  2. xfs_growfs /var/lib/kubelet