Description of problem: When expanding a PVC failed, it's conditions and event message need to be more clear. Version-Release number of selected component (if applicable): oc v3.9.0-0.15.0 openshift v3.9.0-0.15.0 kubernetes v1.9.0-beta1 How reproducible: Always Steps to Reproduce: 1. Enable feature gates: ExpandPersistentVolumes and admission controller: PersistentVolumeClaimResize 2. Create a PV and static provisioning PVC. 3. Expand PVC size from 10G to 20G 4. Using oc get pvc -o yaml and oc describe pvc to check PVC expand result. Actual results: oc get pvc -o yaml output: conditions: - lastProbeTime: null lastTransitionTime: 2018-01-08T06:19:10Z status: "True" type: Resizing oc describe pvc output: Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning VolumeResizeFailed 2m (x10 over 10m) volume_expand Volume has no storage class Expected results: oc get pvc -o yaml output: conditions: - lastProbeTime: null lastTransitionTime: 2018-01-08T06:19:10Z status: "True" type: ResizeFailed oc describe pvc output: Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning VolumeResizeFailed 2m (x10 over 10m) volume_expand Only dynamically provisioned volumes will be allowed to be expanded. Additional info: # cat pv.yaml apiVersion: v1 kind: PersistentVolume metadata: name: pvc-static spec: accessModes: - ReadWriteOnce capacity: storage: 10G glusterfs: endpoints: glusterfs-cluster path: testvol persistentVolumeReclaimPolicy: Delete # cat pvc.json { "apiVersion": "v1", "kind": "PersistentVolumeClaim", "metadata": { "name": "glusterc" }, "spec": { "accessModes": [ "ReadWriteOnce" ], "resources": { "requests": { "storage": "5Gi" } } } } # oc describe pvc Name: glusterc Namespace: mytest StorageClass: Status: Bound Volume: pvc-static Labels: <none> Annotations: pv.kubernetes.io/bind-completed=yes pv.kubernetes.io/bound-by-controller=yes Finalizers: [] Capacity: 10G Access Modes: RWO Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning VolumeResizeFailed 2m (x10 over 10m) volume_expand Volume has no storage class # oc get pvc -o yaml apiVersion: v1 items: - apiVersion: v1 kind: PersistentVolumeClaim metadata: annotations: pv.kubernetes.io/bind-completed: "yes" pv.kubernetes.io/bound-by-controller: "yes" creationTimestamp: 2018-01-08T06:07:46Z name: glusterc namespace: mytest resourceVersion: "26253" selfLink: /api/v1/namespaces/mytest/persistentvolumeclaims/glusterc uid: 3f6c5e0d-f43a-11e7-94f8-fa163e21b9b0 spec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi volumeName: pvc-static status: accessModes: - ReadWriteOnce capacity: storage: 10G conditions: - lastProbeTime: null lastTransitionTime: 2018-01-08T06:19:10Z status: "True" type: Resizing phase: Bound kind: List metadata: resourceVersion: "" selfLink: ""
This is similar to the bug that - admission controller which is supposed to prevent this kind of errors is somehow not working as intended in Openshift. I need to double check.
The underlying problem was - resize admission plugin was not getting enabled because it needs additional code change in openshift to work. fixed via : https://github.com/openshift/origin/pull/18146 After this - any PVC that does not have correct storageclass will throw: "error: persistentvolumeclaims "resize" could not be patched: persistentvolumeclaims "resize" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize"
This bug is targeted to 3.9, while it was attached to 3.7/3.6/3.5 errata, move correct it.
Verified on OCP version: v3.9.0-0.31.0
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0489