Bug 1791786

Summary: PVCs remain pending if storage-class annotation is used instead of storageClassName for LSO
Product: OpenShift Container Platform Reporter: Michal Minar <miminar>
Component: StorageAssignee: Jan Safranek <jsafrane>
Status: CLOSED CURRENTRELEASE QA Contact: Liang Xia <lxia>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.zCC: aos-bugs, jsafrane, scuppett
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Implementation of StorageClass.volumeBindingMode: WaitForFirstConsumer in Kubernetes scheduler did not evaluate beta storage class annotation on Pods. Consequence: Pods could not be scheduled. Fix: Kubernetes scheduler checks both volume.beta.kubernetes.io/storage-class and PVC.Spec.StorageClassName when evaluating a Pod and its PVCs. Result: Pods that use the beta annotation to refer to a StorageClass can be scheduled and will run.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-04 14:19:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Minar 2020-01-16 13:22:59 UTC
Description of problem:

  When volume.beta.kubernetes.io/storage-class is set on PVCs with Local Storage Operator, the PVCs remain pending.
  If instead .spec.storageClassName attribute is set, the PVCs get bound.

Version-Release number of selected component (if applicable):

  oc version
  Client Version: openshift-clients-4.2.2-201910250432
  Server Version: 4.2.10
  Kubernetes Version: v1.14.6+17b1cc6

How reproducible: ALWAYS

Steps to Reproduce:
1. Deploy OCP 4.2 with Local Storage Operator
2. Instantiate Local Volume, e.g.:
    https://gist.github.com/miminar/0a8e57323b00caaf488af1c03bb9fea8#file-localvolume-yaml
3. Wait for PVs to be created
4. Instantiate PVC with volume.beta.kubernetes.io/storage-class annotation instead of .spec.storageClassName attribute pointing to the newly created Storage Class. For example using statefulset like this one:
    https://gist.github.com/miminar/0a8e57323b00caaf488af1c03bb9fea8#file-scann-bug-yaml

Actual results:
  The resulting PVC remains Pending

Expected results:
  The PVC gets Bound

PV Dump: https://gist.github.com/miminar/0a8e57323b00caaf488af1c03bb9fea8#file-local-pv-7b884bb4-yaml

PVC Dump: https://gist.github.com/miminar/0a8e57323b00caaf488af1c03bb9fea8#file-oc-get-pvc-out-yaml

StorageClass Dump (if StorageClass used by PV/PVC): https://gist.github.com/miminar/0a8e57323b00caaf488af1c03bb9fea8#file-local-sc-yaml

Additional info:
  If the volume.beta.kubernetes.io/storage-class annotation in PVC is replaced with .spec.storageClassName, the PVC gets Bound.

Comment 5 Jan Safranek 2020-02-04 14:19:22 UTC
This bug has been fixed in OCP 4.3 and we do not backport "medium" severity fixes.