How can I scale the PVC of a statefulset?

11/27/2018

When I try to edit the PVC, Kubernetes gives error saying:

The StatefulSet "es-data" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden.

I am trying to increase the disk size of elasticsearch which is deployed as a statefulset on AKS.

-- Shibu
elasticsearch
kubernetes

1 Answer

11/27/2018

The error is self explaining. You can only update template and updateStrategy part of a StatefulSet. Also, you can't resize a PVC. However, from kubernetes 1.11 you can resize pvc but it is still alpha feature.

Ref: Resizing an in-use PersistentVolumeClaim

Note: Alpha features are not enabled by default and you have to enable manually while creating the cluster.

-- Emruz Hossain
Source: StackOverflow