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: ""
*** Bug 1487304 has been marked as a duplicate of this bug. ***
Moving back to assigned, it's more complicated. We need external admission webhook. https://github.com/kubernetes/kubernetes/issues/48416
*** Bug 1500645 has been marked as a duplicate of this bug. ***
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.
Im sorry, but this is an actual problem when multiple can be default. This seems very strange to close as Wont Fix, I just recently had two different customers after each other who both had two default storageclasses.
*** Bug 1847935 has been marked as a duplicate of this bug. ***