Update status on PVC when allowVolumeExpansion true?
sjmiller609 opened this issue · comments
Summary
For our use case, we are testing a stateful workload in kubernetes-in-docker, which uses this storage provisioner.
We do not need the enforcement of requests, but it would be nice to be able to update the status field of the pvc.
I would like to suggest the local path provisioner to update the status field, despite nothing actually happening to increase the volume size.
Reproduce
kind create cluster
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.25.3) 🖼
kubectl patch storageclass standard -p '{"allowVolumeExpansion": true}'
storageclass.storage.k8s.io/standard patched
apply this
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: ubuntu
image: ubuntu
command: ["/bin/sleep"]
args: ["3000"]
volumeMounts:
- name: my-pvc
mountPath: /data
volumes:
- name: my-pvc
persistentVolumeClaim:
claimName: my-pvc-claim
check pvc
k get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
my-pvc-claim Bound pvc-3bd61984-4b64-4543-93b6-58dbaec5827e 1Gi RWO standard 38s
Then delete the pod:
kubectl delete pods --all
Increase pvc request to 2Gi, recreate pod. Check on pvc:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
storageClassName: standard
volumeMode: Filesystem
volumeName: pvc-3bd61984-4b64-4543-93b6-58dbaec5827e
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
+1
I no longer care about this issue