3

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.

Hiren Gohel
  • 4,942
  • 6
  • 29
  • 48
Shibu
  • 105
  • 1
  • 6

2 Answers2

1

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
  • 4,764
  • 18
  • 26
  • I get that. Also, I have enabled Alpha features on my cluster. What I need to achieve is to scale the disk allocated to my elasticsearch cluster. I can go ahead and edit the PVC one by one (I have 3 node elasticsearch), but will it get reflected in elasticsearch configuration? Also, If I had to kill the pods of elasticsearch after increasing the PVC manually, won't elasticsearch request a PVC with the size which was set while deploying it? – Shibu Nov 27 '18 at 16:32
  • Hmm.. that could be. You should try in test environment first. You can create pvc separately rather than volumeClaimTemplate. Then it won't have this problem. You can check this guide aobut resizing pvc https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/ – Emruz Hossain Nov 27 '18 at 16:57
0

It is possible to expand the PVC of a statefulset on AKS, following these four steps: https://stackoverflow.com/a/71175193/4083568

Dirc
  • 386
  • 4
  • 9