Increase Replica With Volume of Arbitrary Size With K8s Stateful Set

Photo by patricia serna on Unsplash


Once Statefulset is deployed, volumeClaimTemplates etc. cannot be changed. However, there is a way to change the Volume.

As a result, the volume size in volumeClaimTemplates on the code and the size actually used are different. In that state, if you try to Scale, the volume and size that have already been expanded will be different, and the balance will be lost.


  • Create PVC according to the naming convention of pvc generated by Volume size + statefulset
  • Scale out

Create PVC

The pvc created from VolumeClaimTemplate is, <volumeClaimTemplateName>-<pod_name>so in this case it was test-storage-4-testing.

- metadata:
name: test-storage
annotations: gp2-topology-aware
accessModes: [ "ReadWriteOnce" ]
storage: 10Gi
apiVersion: v1
kind: PersistentVolumeClaim
annotations: gp2-topology-aware
name: test-storage-4-testing
- ReadWriteOnce
storage: 3Gi

At this time, if volumeBindingMode: WaitForFirstConsumer you are using it, wait until the pod claims and the following message appears

Normal WaitForFirstConsumer 11s (x3 over 20s) persistentvolume-controller waiting for first consumer to be created before binding

 by the author.




DevOps Consultant. I’m strongly focused on automation, security, and reliability.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Feather vs Parquet vs CSV vs Jay

Building an API on open data

Handling Conflicts Using Tortoise


Guide on Java Architecture & Components for Beginners

How To Undo Last Git Commit

AMA (#AskMeAnything) with CEO Michael Ein Chaybeh of StreamCoin (STRM) Session 3

How Delete All the Queues From RabbitMQ?

problem statement : root the tree (from codechef lunchtime september 2020)(

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


DevOps Consultant. I’m strongly focused on automation, security, and reliability.

More from Medium

Deploy and use ArgoCD with Portainer (part 2)

Prune Container Images from Rancher using Kubernetes CronJob and Binaries

Improve your productivity with Kubernetes using aliases

How to Build a Kubernetes Environment & Scale Production