Bug 1471718 - [RFE] Allow to create storageclass at installation time
[RFE] Allow to create storageclass at installation time
Status: VERIFIED
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer (Show other bugs)
3.5.0
Unspecified Unspecified
low Severity medium
: ---
: 3.10.0
Assigned To: Scott Dodson
Gaoyun Pei
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-17 06:13 EDT by Eduardo Minguez
Modified: 2018-04-18 13:41 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
You may now configure an arbitrary storage class at installation time. In order to do so set variables like the following in your inventory. openshift_storageclass_name=test-1 openshift_storageclass_provisioner=rbd openshift_storageclass_parameters={'fstype': 'ext4', 'iopsPerGB': '10', 'foo': 'bar'}
Story Points: ---
Clone Of:
Environment:
Last Closed:
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 Eduardo Minguez 2017-07-17 06:13:57 EDT
Description of problem:
If you want to deploy logging at installation time using dynamic storage, you need to create the storageclass before the logging is deployed otherwise it will be stuck trying to create storage

Version-Release number of the following components:
rpm -q openshift-ansible
rpm -q ansible
ansible --version
[edu@bastion ~]$ rpm -q openshift-ansible
openshift-ansible-3.5.91-1.git.0.28b3ddb.el7.noarch
[edu@bastion ~]$ rpm -q ansible
ansible-2.2.3.0-1.el7.noarch
[edu@bastion ~]$ ansible --version
ansible 2.2.3.0
  config file = /home/edu/.ansible.cfg
  configured module search path = ['/usr/share/ansible', '/usr/share/ansible/openshift-ansible/library']


How reproducible:
Try to create a PVC as the installer finishes.

Steps to Reproduce:
1. Install OCP
2. Try to create a PVC as the installer finishes.
3.

Actual results:
Please include the entire output from the last TASK line through the end of output if an error is generated
It cannot bind any PV to the PVC as the storageclass is not created yet.

Expected results:
Some ansible variable to specify a storageclass to be created at installation time.

Additional info:
Please attach logs from ansible-playbook with the -vvv flag
Comment 1 Scott Dodson 2017-08-29 15:53:38 EDT
Eduardo what cloud provider are you using?
Comment 2 Eduardo Minguez 2017-08-30 04:45:38 EDT
Hi Scott,

I think this should be "cross provider" because if you want to deploy logging at installation time with a custom storageclass, you should do it no matter what provider you are using.

I think the idea will be to have an ansible variable with the storageclass definition and create it just after the installation and before creating the router, registry, logging, etc. so you can use it "out of the box" for the registry, logging, metrics, etc.

Thanks!
Comment 3 Scott Dodson 2017-08-30 08:26:19 EDT
Yeah, we do that today for GCE and AWS. But I believe there's no way to define a generic default storage class that works across all providers, am I mistaken?
Comment 4 Eduardo Minguez 2017-08-30 08:46:50 EDT
Not generic, but to be able to allow users to create them at installation time. I'm thinking in something like this (just an example)

* default_storageclass_name = whatever
* default_storageclass_provisioner = kubernetes.io/rbd (or any other)
* default_storageclass_parameters = [{'fstype': 'ext4',
'iopsPerGB': '10', 'foo': 'bar'}]
Comment 5 Eduardo Minguez 2017-08-30 08:48:26 EDT
Sorry, pressed enter too soon...
Or something like the ldap authentication stuff:

* default_storage_class = [{'name': 'whatever',
'provisioner': 'kubernetes.io/rbd', 'fstype': 'ext4',
'iopsPerGB': '10', 'foo': 'bar'}]
Comment 7 Scott Dodson 2018-04-16 10:50:46 EDT
Default storage classes should be created in 3.9 and later.
Comment 8 Gaoyun Pei 2018-04-18 04:17:55 EDT
Verify this bug with openshift-ansible-3.10.0-0.22.0.git.0.b6ec617.el7.noarch.rpm

With the following options setting in inventory file, start installation.
openshift_storageclass_name=test-1
openshift_storageclass_provisioner=rbd
openshift_storageclass_parameters={'fstype': 'ext4', 'iopsPerGB': '10', 'foo': 'bar'}

After installation finished, check the default storageclass

[root@qe-gpei-310test2master-etcd-1 ~]# oc get storageclass
NAME               PROVISIONER         AGE
test-1 (default)   kubernetes.io/rbd   1h
[root@qe-gpei-310test2master-etcd-1 ~]# oc describe storageclass test-1
Name:                  test-1
IsDefaultClass:        Yes
Annotations:           storageclass.beta.kubernetes.io/is-default-class=true
Provisioner:           kubernetes.io/rbd
Parameters:            foo=bar,fstype=ext4,iopsPerGB=10
AllowVolumeExpansion:  <unset>
MountOptions:          <none>
ReclaimPolicy:         Delete
VolumeBindingMode:     Immediate
Events:                <none>

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