Bug 1487304 - More than one default storageclass shouldn't be allowed
Summary: More than one default storageclass shouldn't be allowed
Keywords:
Status: CLOSED DUPLICATE of bug 1464606
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.6.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Pavel Pospisil
QA Contact: Liang Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-31 15:17 UTC by Eduardo Minguez
Modified: 2017-09-07 19:52 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-07 19:52:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Eduardo Minguez 2017-08-31 15:17:20 UTC
Description of problem:
If you create two different storageclasses with the storageclass.kubernetes.io/is-default-class: "true" annotation, you'll end up with two default storageclasses.

Version-Release number of selected component (if applicable):
[cloud-user@master-0 ~]$ oc version
oc v3.6.173.0.5
kubernetes v1.6.1+5115d708d7
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://openshift.refarch.roger.com:8443
openshift v3.6.173.0.5
kubernetes v1.6.1+5115d708d7

How reproducible:
create two different storageclasses with the storageclass.kubernetes.io/is-default-class: "true" annotation

Steps to Reproduce:
1. cat << EOF | oc create -f -
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: standard
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: kubernetes.io/cinder
parameters:
  availability: nova
EOF
2. cat << EOF | oc create -f -
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
  annotations:
    storageclass.beta.kubernetes.io/is-default-class: "true"
  name: ceph
parameters:
  adminId: storageclass
  adminSecretName: ceph-secret
  adminSecretNamespace: default
  monitors: 10.19.115.3:6789,10.19.115.5:6789,10.19.115.8:6789
  pool: pit_storageclass
  userSecretName: ceph-secret
provisioner: kubernetes.io/rbd
EOF

3. oc get storageclass

Actual results:
NAME                 TYPE
ceph (default)       kubernetes.io/rbd      
standard (default)   kubernetes.io/cinder 

Expected results:
When you try to create the second "default" storageclass, oc should fail and allow only 1 default storageclass

Master Log:
No relevant

Node Log (of failed PODs):
No relevant

PV Dump:
No relevant

PVC Dump:
No relevant

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

Additional info:

When you try to create a pvc when you have two storageclasses, it fails:

cat << EOF | oc create -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
  name: test001
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
EOF
Error from server (Forbidden): error when creating "mypvc.yaml": persistentvolumeclaims "test001" is forbidden: Internal error occurred: 2 default StorageClasses were found

Comment 1 Pavel Pospisil 2017-09-06 08:52:14 UTC
This issue is being discussed at Github: https://github.com/kubernetes/kubernetes/issues/48416

Comment 3 Bradley Childs 2017-09-07 19:52:47 UTC

*** This bug has been marked as a duplicate of bug 1464606 ***


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