Manage kubernetes StatefulSet

Manage kubernetes StatefulSet

March 23, 2023

Operations

Increase the storage sizes without downtime

We cannot update the resources.storageSize of the StatefulSet to increase the volume sizes. So, we have to follow a few steps to update them.

See this article for more details.

  1. Confirm if the storageclass of persistent volumes has .allowVolumeExpansion=true

    > kubectl get storageclass standard -o yaml | yq .allowVolumeExpansion
    true
    ```
  2. Update all PVC to have more storage sizes

  3. Delete the statefulset objects without deleting pods by kubectl delete statefulset $statefulset_name --cascade=orphan

  4. Recreate the statefulset with the new storage size

Decrease the storage size

Shrinking disk sizes is not supported. official document.

Last updated on