oci-cloud-controller-manager
oci-cloud-controller-manager copied to clipboard
[BUG REPORT] PVC failed to resize
Is this a BUG REPORT or FEATURE REQUEST?
BUG REPORT
Versions
CCM Version: v1.27.2
Environment:
- Kubernetes version (use
kubectl version): 1.27.10 - OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a): - Others:
What happened?
There is a chance that resizeing block volume PVCs (Persitent Volume Claim) resulting in the PV (Persistent Volume) getting the wrong size. E.g. Increasing PVC from 50 Gi to 51 Gi, caused the PV to be 51 bytes
What you expected to happen?
Expected both PV and PVC to be 51 Gi after resizing
How to reproduce it (as minimally and precisely as possible)?
Create a PVC and pod, then wait for it to be ready
apiVersion: v1
kind: Pod
metadata:
name: volume-pvc
spec:
containers:
- name: frontend
image: nginx
volumeMounts:
- mountPath: /usr/share/nginx/html
name: volume-pvc
volumes:
- name: volume-pvc
persistentVolumeClaim:
claimName: persistent-volume-claim
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: persistent-volume-claim
spec:
storageClassName: oci-bv
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Gi
Edit the PVC to increase the size
apiVersion: v1
kind: PersistentVolume
metadata:
name: persistent-volume-claim
spec:
storageClassName: oci-bv
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 51Gi
It does not always happen, but it seems to happen more often the more PVCs are resized at the same time.
Anything else we need to know?
The faulty PV can be fixed by adding Gi to the capacity and will work as expected after that. It is only the PV that is misconfigured