huaweicloud / huaweicloud-service-broker

Huawei Cloud Service Broker
Apache License 2.0
18 stars 12 forks source link

Management of the unicity of created resources for service instance and Databases #71

Closed yeplaa closed 4 years ago

yeplaa commented 5 years ago

Hello,

From Openshift Origin, i use huaweicloud-service-broker for provision RDS Mysql and DCS Redis on Flexible Engine OBS.
In my context, i use it in cluster mode available for all projects in the openshift cluster. The databases will be deployed in the same Flexible Engine tenant, VPC for all projects.

Currently, there is no management of the uniqueness of the instance service names as well as the names of the databases created for 2 different projects. For example, actually a user of project1 can provision a rds mysql database named mysql1. Nothing will prevent a project2 from wanting to create too a rds mysql database named mysql1.
The second provisioning will fail because the database named mysql1 will already exist. It's the same issue with the service instance name.

For the Database name, would it be possible to add in the config.json an option allowing the possibility to add, to force a suffix to the names of database, service instance created? This suffix could be the name of the project for example. For example, the user of the project1 who will wish named mysql1 will have his database automatically named mysql1-project1

For the service instance created, it is also necessary for me to do a project / namespace isolation in the mysql backend of Huawei Service Broker.

What do you think? Is there already an existing solution to my problem?

Thank's very much Loïc

edisonxiang commented 5 years ago

Hey @yeplaa,

Currently we can specify the name of instance here. https://github.com/huaweicloud/huaweicloud-service-broker/blob/master/openshift/examples/mysql/mysql-service-instance.yaml#L13 This is also the better way to do namespace isolation here. e.g: "mysql1-project1" If the broker adds some suffix for the name of serviceinstance automatically, for example, the users provision the mysql serviceinstance named "mysql1", the broker adds suffix "-project1" into the name, so the name becomes "mysql1-project1". Next time the users want to update the serviceinstance name in the yaml or openshift web ui, I guess the users will be confused with the name. Actually the serviceinstance name "mysql1" has already been different from the backend name "mysql1-project1".

what do you think about that?

yeplaa commented 5 years ago

Hi @edisonxiang,

Thank's four your reply.

For the name of instance, indeed, it is complicated to suffix the name as you mention it. But, would be it possible to manage this isolation at the level of the service-broker-0 statefulset (with his mysql backend) if the Open service Broker API standard supports the transfer of Project / Namespace name (with the provision, update, bind verbs)?

Regarding the database name created, i think that a suffix add by the config.json (by a option) may be the right solution. If it 's possible to add this information in the description field of the variable name (on Openshift GUI for the provisioning from the catalog and in the doc) the customer will have the information.

What do you think?

Thank's Loïc

edisonxiang commented 5 years ago

Hey @yeplaa , I understand your problem now :) Do you expect to add suffix configuration in the config.json in one place or in every plan's parameters?