<div dir="ltr"><div><font face="georgia, serif"><font color="#333333"><span style="line-height:18px">Hi All,</span></font></font></div><font face="georgia, serif"><font color="#333333"><span style="line-height:18px"><div><font face="georgia, serif"><font color="#333333"><span style="line-height:18px"><br></span></font></font></div>Currently, it is possible to create unlimited number of resource like bay/pod/service/. In Magnum, </span></font><span style="color:rgb(51,51,51);line-height:18px">there should be a limitation for user or project to create Magnum resource,</span><br style="color:rgb(51,51,51);line-height:18px"><span style="color:rgb(51,51,51);line-height:18px">and the limitation should be configurable[1]. </span></font><div><div><font face="georgia, serif"><span style="color:rgb(51,51,51);line-height:18px"><br></span></font></div><div><font face="georgia, serif"><span style="color:rgb(51,51,51);line-height:18px">I proposed following design :-</span></font></div><div><font face="georgia, serif"><span style="color:rgb(51,51,51);line-height:18px"><br></span></font></div><div><font face="georgia, serif"><span style="color:rgb(51,51,51);line-height:18px">1. Introduce new table magnum.quotas</span></font></div><div><span style="font-family:georgia,serif">+------------+--------------+------+-----+---------+----------------+</span><br></div><div>
<p class=""><span class=""><font face="georgia, serif">| Field      | Type         | Null | Key | Default | Extra          |</font></span></p>
<p class=""><span class=""><font face="georgia, serif">+------------+--------------+------+-----+---------+----------------+</font></span></p>
<p class=""><span class=""><font face="georgia, serif">| id         | int(11)      | NO   | PRI | NULL    | auto_increment |</font></span></p>
<p class=""><span class=""><font face="georgia, serif">| created_at | datetime     | YES  |     | NULL    |                |</font></span></p>
<p class=""><span class=""><font face="georgia, serif">| updated_at | datetime     | YES  |     | NULL    |                |</font></span></p>
<p class=""><span class=""><font face="georgia, serif">| deleted_at | datetime     | YES  |     | NULL    |                |</font></span></p>
<p class=""><span class=""><font face="georgia, serif">| project_id | varchar(255) | YES  | MUL | NULL    |                |</font></span></p>
<p class=""><span class=""><font face="georgia, serif">| resource   | varchar(255) | NO   |     | NULL    |                |</font></span></p>
<p class=""><span class=""><font face="georgia, serif">| hard_limit | int(11)      | YES  |     | NULL    |                |</font></span></p>
<p class=""><span class=""><font face="georgia, serif">| deleted    | int(11)      | YES  |     | NULL    |                |</font></span></p>
<p class=""><span class=""><font face="georgia, serif">+------------+--------------+------+-----+---------+----------------+</font></span></p>
<p class="">resource can be Bay, Pod, Containers, etc.<br></p><p class=""><br></p><p class="">2. API controller for quota will be created to make sure basic CLI commands work.</p><p class="">quota-show, quota-delete, quota-create, quota-update</p><p class="">3. When the admin specifies a quota of X number of resources to be created the code should abide by that. For example if hard limit for Bay is 5 (i.e. a project can have maximum 5 Bay's) if a user in a project tries to exceed that hardlimit it won't be allowed. Similarly goes for other resources. <br></p><p class="">4. Please note the quota validation only works for resources created via Magnum. Could not think of a way that Magnum to know if a COE specific utilities created a resource in background. One way could be to see the difference between whats stored in magnum.quotas and the information of the actual resources created for a particular bay in k8s/COE.<br></p><p class="">5. Introduce a config variable to set quotas values.<br></p><p class="">If everyone agrees will start the changes by introducing quota restrictions on Bay creation.<br></p><p class="">Thoughts ??<br></p><p class=""><br></p><p class="">-Vilobh</p><p class="">[1] <a href="https://blueprints.launchpad.net/magnum/+spec/resource-quota">https://blueprints.launchpad.net/magnum/+spec/resource-quota</a></p></div></div></div>