oracle / oci-cloud-controller-manager

Kubernetes Cloud Controller Manager implementation for Oracle Cloud Infrastructure
Apache License 2.0
137 stars 86 forks source link

[BUG REPORT] PVC failed to resize #466

Closed tobmad closed 1 month ago

tobmad commented 6 months ago

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

Versions

CCM Version: v1.27.2

Environment:

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

AkarshES commented 1 month ago

Resolved via Release 1.28.1