Have anyone managed to resize a k8s volume (AWS EBS) with zero downtime on k8s 1.8 without using the volume expansion alpha feature? I’m trying to find a way to do that in one of my Statefulsets clusters (3 replicas) but don’t know how.
With outage, I can do that by simply:
But how to do that preventing outage? I cannot use the k8s alpha features and I cannot upgrade my k8s cluster yet.
Another thing I considered was in step 1, scale it down to 1 replica instead, thus I could expand my volumes of the PODs 1 and 2 while POD 0 was still up and running, but how will I do that on POD 0 later on? There's a way to turn of a specific POD of a Stetfulsets? Eg.: Turn off POD 0 in order I can expand its volume after have done for POD 1 and 2?
I would have skipped step 4 and just created a new statefulset pointing to the new PV
volumeClaimTemplate:
spec:
selector:
matchLabels:
app: my-stateful-app
resources:
requests:
storage: 50Gi
Respective PV
apiVersion: v1
kind: PersistentVolume
metadata:
name: my-pv-name
labels:
app: my-stateful-app
spec:
capacity:
storage: 50Gi
accessModes:
- ReadWriteOnce
awsElasticBlockStore:
volumeID: <volume-id>
fsType: ext4