Bug 1471718 - [RFE] Allow to create storageclass at installation time
Summary: [RFE] Allow to create storageclass at installation time
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: 3.10.0
Assignee: Scott Dodson
QA Contact: Gaoyun Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-17 10:13 UTC by Eduardo Minguez
Modified: 2018-07-30 19:09 UTC (History)
7 users (show)

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'}
Clone Of:
Environment:
Last Closed: 2018-07-30 19:08:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1816 0 None None None 2018-07-30 19:09:27 UTC

Description Eduardo Minguez 2017-07-17 10:13:57 UTC
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 19:53:38 UTC
Eduardo what cloud provider are you using?

Comment 2 Eduardo Minguez 2017-08-30 08:45:38 UTC
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 12:26:19 UTC
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 12:46:50 UTC
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 12:48:26 UTC
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 14:50:46 UTC
Default storage classes should be created in 3.9 and later.

Comment 8 Gaoyun Pei 2018-04-18 08:17:55 UTC
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>

Comment 10 errata-xmlrpc 2018-07-30 19:08:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1816


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