Bug 1791786 - PVCs remain pending if storage-class annotation is used instead of storageClassName for LSO
Summary: PVCs remain pending if storage-class annotation is used instead of storageCla...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 4.2.z
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.4.0
Assignee: Jan Safranek
QA Contact: Liang Xia
Depends On:
TreeView+ depends on / blocked
Reported: 2020-01-16 13:22 UTC by Michal Minar
Modified: 2020-04-16 16:24 UTC (History)
3 users (show)

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.
Clone Of:
Last Closed: 2020-02-04 14:19:22 UTC
Target Upstream Version:

Attachments (Terms of Use)

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.:
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:

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.

Note You need to log in before you can comment on or make changes to this bug.