-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: lengrongfu <[email protected]>
- Loading branch information
1 parent
b4c27b4
commit 6737df9
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# System Quota | ||
|
||
Author: Leng RongFu | ||
|
||
## Abstract | ||
|
||
Harbor enforces quotas on resource usage of system , setting a hard limit on storage your system can use and can not push artificial when user storage more than system write storage limit. | ||
|
||
|
||
## Background | ||
|
||
Currently, users can set project storage quota, but every project quota is independent,maybe this project storage quota sum while more then system storage, so we need set system storage quota, in the set project storage quota is to check current project storage quota whether more then system storage quota. | ||
|
||
|
||
## User Stories | ||
|
||
### Story 1 | ||
As a system administrator, I can set the default limit on system storage. | ||
|
||
## Premise | ||
1, The shared blob in project won't be be double-counted. | ||
2, The shared blob cross project will be be double-counted. | ||
|
||
## Proposal | ||
|
||
We propose the following solutions: | ||
|
||
1. In the quota management page when administration update project quota, get system storage quota, if values is -1. skip validate. | ||
2. else validate whether sum of all quotas more than the system quota. | ||
|
||
### APIs for system storage quota | ||
|
||
1. Get quotas | ||
|
||
``` | ||
GET /api/v2.0/configurations | ||
{ | ||
"hard_storage": { | ||
"editable": true, | ||
"value": "1G"# when user not setting, system default value is -1. | ||
} | ||
} | ||
``` | ||
2. Update quota | ||
``` | ||
PUT /api/v2.0/configurations | ||
{ | ||
"hard_storage":"1G", | ||
} | ||
``` | ||
### Configurations Manager | ||
Update `AllConfigs(ctx context.Context) (map[string]interface{}, error)` and `UpdateUserConfigs(ctx context.Context, conf map[string]interface{}) error` method. | ||
### Project Manager | ||
1. Update project quota | ||
- Get system hard storage limit. | ||
- List all quota info, calculate the sum of the current project quota. | ||
- Check whether the system storage quota is exceeded. | ||