You may need to grow a volume for the KUMA Core or Metrics service for a KUMA installation in production.
Before growing volumes, you need to make sure that there is enough free space in the /opt directory on the worker nodes of the cluster. You need at least twice as much free space as the planned volume size.
Starting with KUMA 4.0.1, the installer includes the roles/k0s_prepare/files/k0s-pvc-expand.sh script, which is copied to the /root/k0s/ directory on the primary controller of the cluster. This script lets you grow a volume in an production cluster.
Growing a volume using the k0s-pvc-expand.sh script
You can grow a volume in one of the following ways:
core or metrics option, depending on which volume you want to apply the action to, and specify the new volume size in gigabytes. The volume size must be specified as an integer number without a suffix.Example command for growing the Metrics service volume to 100 GB:
sudo ./k0s-pvc-expand.sh metrics 100
Example command for growing the Core volume to 200 GB:
sudo ./k0s-pvc-expand.sh core 200
Script behavior
If the specified volume size is less than or equal to the current size, nothing is done and the script aborts with an error message.
If the new volume size is greater than the current size, the script stops the service that uses the volume (KUMA Core or Metrics). After disconnecting the volume from the pods of the service, the script grows the volume. After resizing the volume, the service is restarted and the expanded volume becomes available to it.
After growing the volume in preparation for an upgrade to later versions of KUMA, you will not need to further specify any volume sizes in the inventory because the KUMA installer will use current volume sizes and ignore values from variables from the inventory file that do not match the current values.
Page top