kubernetesyugabytedb

Yugabyte DB how to scale up disk storage size


I have deployed a Yugabyte cluster on Azure via helm chart. I'm wondering how to scale up disk storage size.

It was failed when I tried to update helm chart to scale up disk storage size from 10GB to 100GB by change storage->tserver->size in values.yaml. it showed error bellow:

Error: UPGRADE FAILED: cannot patch "yb-tserver" with kind StatefulSet: StatefulSet.apps "yb-tserver" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbiddenr->size.

enter image description here

is it only could operator PVC directly to scale up disk size via kubectl?


Solution

  • Kubernetes does not allow resizing volume for statefulset as is.

    You can read a detailed example here on how to handle resizing for statefulset. Example uses an nginx pod, but the basics are same.

    tl;dr

    1. resize the PVC
    2. delete the statefulset resource, without cascaded deletion of Pods
    3. create the statefulset resource again with release and rebind PVC.

    Step 3, in case of YugabyteDB is done using helm upgrade. You can control the rollout (release and rebind) using the partition.master and partition.tserver values (value.yaml)