Increase Replica With Volume of Arbitrary Size With K8s Stateful Set

Introduction

Solution

Create PVC

...
volumeClaimTemplates:
- metadata:
name: test-storage
annotations:
volume.beta.kubernetes.io/storage-class: gp2-topology-aware
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-class: gp2-topology-aware
name: test-storage-4-testing
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
Normal WaitForFirstConsumer 11s (x3 over 20s) persistentvolume-controller waiting for first consumer to be created before binding

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