Skip to content

Commit 6737df9

Browse files
committed
add system quota
Signed-off-by: lengrongfu <[email protected]>
1 parent b4c27b4 commit 6737df9

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

proposals/new/system-quota.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# System Quota
2+
3+
Author: Leng RongFu
4+
5+
## Abstract
6+
7+
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.
8+
9+
10+
## Background
11+
12+
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.
13+
14+
15+
## User Stories
16+
17+
### Story 1
18+
As a system administrator, I can set the default limit on system storage.
19+
20+
## Premise
21+
1, The shared blob in project won't be be double-counted.
22+
2, The shared blob cross project will be be double-counted.
23+
24+
## Proposal
25+
26+
We propose the following solutions:
27+
28+
1. In the quota management page when administration update project quota, get system storage quota, if values is -1. skip validate.
29+
2. else validate whether sum of all quotas more than the system quota.
30+
31+
### APIs for system storage quota
32+
33+
1. Get quotas
34+
35+
```
36+
GET /api/v2.0/configurations
37+
{
38+
"hard_storage": {
39+
"editable": true,
40+
"value": "1G"# when user not setting, system default value is -1.
41+
}
42+
}
43+
```
44+
45+
2. Update quota
46+
47+
```
48+
PUT /api/v2.0/configurations
49+
{
50+
"hard_storage":"1G",
51+
}
52+
```
53+
54+
55+
### Configurations Manager
56+
57+
Update `AllConfigs(ctx context.Context) (map[string]interface{}, error)` and `UpdateUserConfigs(ctx context.Context, conf map[string]interface{}) error` method.
58+
59+
### Project Manager
60+
1. Update project quota
61+
- Get system hard storage limit.
62+
- List all quota info, calculate the sum of the current project quota.
63+
- Check whether the system storage quota is exceeded.
64+

0 commit comments

Comments
 (0)