Bug 1464606 - system does not check against the fact that multiple storage class are defined as defaults
system does not check against the fact that multiple storage class are define...
Status: CLOSED WONTFIX
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage (Show other bugs)
3.5.1
Unspecified Unspecified
low Severity low
: ---
: 3.7.0
Assigned To: Jan Safranek
Liang Xia
: NeedsTestCase
: 1487304 1500645 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-23 18:08 EDT by raffaele spazzoli
Modified: 2018-01-09 12:09 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-01-09 12:09:44 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description raffaele spazzoli 2017-06-23 18:08:36 EDT
Description of problem:
you can define multiple storage classes as default
es:

[rspazzol@rspazzol F5]$ oc get storageclass
NAME                          TYPE
iscsi (default)               iscsi           
local-pod-default (default)   local-pod/nfs  

How reproducible:
100%

Steps to Reproduce:
define multiple storage classes as default

Actual results:
multiple storage classes are defined as default (unknown system behavior when a pvc is actually created)


Expected results:
either an error message or that the default property is moved to the latest storage class that was defined as default.


StorageClass Dump (if StorageClass used by PV/PVC):

[rspazzol@rspazzol F5]$ oc get storageclass -o yaml
apiVersion: v1
items:
- apiVersion: storage.k8s.io/v1beta1
  kind: StorageClass
  metadata:
    annotations:
      storageclass.beta.kubernetes.io/is-default-class: "true"
    creationTimestamp: 2017-06-21T19:05:39Z
    name: iscsi
    namespace: ""
    resourceVersion: "404538"
    selfLink: /apis/storage.k8s.io/v1beta1/storageclasses/iscsi
    uid: 9d4974ce-56b4-11e7-89a7-fa163ea64764
  parameters:
    initiators: iqn.2003-03.com.raffa:master-0,iqn.2003-03.com.raffa:app-node-1,iqn.2003-03.com.raffa:app-node-0,iqn.2003-03.com.raffa:infranode-0
    iqn: iqn.2003-01.org.example.mach1:1234
    iscsiInterface: default
    targetPortal: 192.168.80.110:3260
    volumeGroup: vg-targetd
  provisioner: iscsi
- apiVersion: storage.k8s.io/v1beta1
  kind: StorageClass
  metadata:
    annotations:
      storageclass.beta.kubernetes.io/is-default-class: "true"
    creationTimestamp: 2017-06-17T04:09:54Z
    name: local-pod-default
    namespace: ""
    resourceVersion: "109385"
    selfLink: /apis/storage.k8s.io/v1beta1/storageclasses/local-pod-default
    uid: d11ea492-5312-11e7-89a7-fa163ea64764
  provisioner: local-pod/nfs
kind: List
metadata: {}
resourceVersion: ""
selfLink: ""
Comment 4 Bradley Childs 2017-09-07 15:52:47 EDT
*** Bug 1487304 has been marked as a duplicate of this bug. ***
Comment 5 Jan Safranek 2017-09-11 04:53:38 EDT
Moving back to assigned, it's more complicated. We need external admission webhook. https://github.com/kubernetes/kubernetes/issues/48416
Comment 6 Jan Safranek 2017-10-17 11:03:29 EDT
*** Bug 1500645 has been marked as a duplicate of this bug. ***
Comment 7 Jan Safranek 2018-01-09 12:09:29 EST
I am closing this bug for now.

Reason why it's so complicated: There may be two or more API servers, each running its own admission controller. Any admission plugin that makes sure only one default StorageClass exists is therefore racy.

We brainstormed about some solutions, see https://github.com/kubernetes/kubernetes/pull/48185, but that's where we stopped. It would require an external admission hook running in a pod and we'd need to install it during Kubernetes and OpenShift installation, solve upgrades, high availability and such.

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