Skip to content

Commit 7612586

Browse files
authored
PROJQUAY-3229 Quota UI (#392)
1 parent be9fb97 commit 7612586

20 files changed

+159
-73
lines changed

early_access/master.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ include::modules/quota-management-arch.adoc[leveloffset=+3]
3434
include::modules/quota-management-limitations.adoc[leveloffset=+3]
3535

3636
include::modules/config-fields-quota.adoc[leveloffset=+3]
37-
//include::modules/quota-establishment-ui.adoc[leveloffset=+3]
37+
include::modules/quota-establishment-ui.adoc[leveloffset=+3]
3838
include::modules/quota-establishment-api.adoc[leveloffset=+3]
3939

4040
include::modules/api-namespacequota.adoc[leveloffset=+2]

images/quota-none-org-settings.png

243 KB
Loading

images/quota-notifications.png

88.4 KB
Loading

images/quota-org-consumed-first.png

49.5 KB
Loading

images/quota-org-consumed-second.png

57 KB
Loading

images/quota-org-init-consumed.png

126 KB
Loading

images/quota-org-quota-policy.png

86.7 KB
Loading

images/quota-second-image.png

-73.1 KB
Binary file not shown.

images/quota-su-consumed-first.png

28.9 KB
Loading

images/quota-su-increase-100MB.png

84.2 KB
Loading

images/quota-su-init-10MB.png

108 KB
Loading

images/quota-su-init-consumed.png

71.8 KB
Loading

images/quota-su-org-options.png

135 KB
Loading

images/quota-su-reject-80.png

34 KB
Loading

images/quota-su-warning-70.png

33.3 KB
Loading

manage_quay/master.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ include::modules/metrics-authentication.adoc[leveloffset=+3]
114114
//include::modules/proc_manage-quay-geo-replication.adoc[leveloffset=+1]
115115

116116
include::modules/quota-management-and-enforcement.adoc[leveloffset=+1]
117+
include::modules/config-fields-quota.adoc[leveloffset=+2]
117118
include::modules/quota-management-arch.adoc[leveloffset=+2]
119+
include::modules/quota-establishment-ui.adoc[leveloffset=+2]
120+
include::modules/quota-establishment-api.adoc[leveloffset=+2]
118121
include::modules/quota-management-limitations.adoc[leveloffset=+2]
119-
include::modules/config-fields-quota.adoc[leveloffset=+3]
120-
//include::modules/quota-establishment-ui.adoc[leveloffset=+3]
121-
include::modules/quota-establishment-api.adoc[leveloffset=+3]
122122

123123

124124
include::modules/georepl-intro.adoc[leveloffset=+1]

modules/config-fields-quota.adoc

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ Quota management is now supported under the `FEATURE_QUOTA_MANAGEMENT` property.
66
[source,yaml]
77
----
88
FEATURE_QUOTA_MANAGEMENT: true
9-
----
9+
----
10+
11+
12+
[NOTE]
13+
====
14+
In {productname} 3.7, superuser privileges are required to create, update and delete quotas.
15+
====

modules/proc_manage-advanced-config.adoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ after the initial {productname} deployment, you can restart the
7474
Config Tool to modify your {productname} cluster. Here's how:
7575

7676
. **Start quay in config mode**: On the first `quay` node run the following, replacing
77-
`my-secret-password` with your password. If you would like to modify an existing config bundle,
77+
`my-secret-password` with your password. If you would like to modify an existing config bundle,
7878
you can simply mount your configuration directory into the `Quay` container as you would in registry mode.
7979
+
8080
[subs="verbatim,attributes"]
@@ -195,19 +195,19 @@ The `sslmode` option determines whether or with what priority a secure SSL TCP/I
195195
* **verify-ca:** only try an SSL connection, and verify that the server certificate is issued by a trusted certificate authority (CA)
196196
* **verify-full:** only try an SSL connection, verify that the server certificate is issued by a trusted CA and that the requested server host name matches that in the certificate
197197

198-
More information on the valid arguments for PostgreSQL is available at link:https://www.postgresql.org/docs/current/libpq-connect.html[].
198+
More information on the valid arguments for PostgreSQL is available at link:https://www.postgresql.org/docs/current/libpq-connect.html[].
199199

200200
===== MySQL SSL connection arguments
201201

202202
A sample MySQL SSL configuration follows:
203203

204204
----
205205
DB_CONNECTION_ARGS:
206-
ssl:
206+
ssl:
207207
ca: /path/to/cacert
208208
----
209209

210-
Information on the valid connection arguments for MySQL is available at link:https://dev.mysql.com/doc/refman/8.0/en/connecting-using-uri-or-key-value-pairs.html[].
210+
Information on the valid connection arguments for MySQL is available at link:https://dev.mysql.com/doc/refman/8.0/en/connecting-using-uri-or-key-value-pairs.html[].
211211

212212

213213
==== HTTP connection counts
@@ -224,7 +224,7 @@ WORKER_CONNECTION_COUNT_SECSCAN=n
224224
WORKER_CONNECTION_COUNT=n
225225
----
226226

227-
[Note]
227+
[NOTE]
228228
====
229229
Specifying a count for a specific component will override any value
230230
set in WORKER_CONNECTION_COUNT.

modules/quota-establishment-api.adoc

+47-49
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
[[quota-establishment-api]]
2-
= Establishing quota with the {productname} API
2+
= Establishing quota with the {productname} API
33

4-
When an organization is first created, it does not have a quota applied.
4+
When an organization is first created, it does not have a quota applied. Use the */api/v1/organization/{organization}/quota* endpoint:
55

6-
.No initial quota
7-
image:quota-no-quota.png[No quota]
6+
.Sample command
7+
[source,terminal]
8+
----
9+
$ curl -k -X GET -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota | jq
10+
----
11+
12+
.Sample output
13+
[source,terminal]
14+
----
15+
[]
16+
----
817

918
== Setting the quota
1019

20+
To set a quota for an organization, POST data to the */api/v1/organization/{orgname}/quota* endpoint:
1121
.Sample command
1222
[source,terminal]
1323
----
@@ -22,10 +32,12 @@ $ curl -k -X POST -H "Authorization: Bearer <token>" -H 'Content-Type: applicati
2232

2333
== Viewing the quota
2434

35+
To see the applied quota, GET data from the */api/v1/organization/{orgname}/quota* endpoint:
36+
2537
.Sample command
2638
[source,terminal]
2739
----
28-
$ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLwwIL" -H 'Content-Type: application/json' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota | jq
40+
$ curl -k -X GET -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota | jq
2941
----
3042

3143
.Sample output
@@ -42,18 +54,14 @@ $ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLw
4254
]
4355
----
4456

45-
46-
.Organization quota of 10MB
47-
image:quota-10MB-empty.png[10MB quota]
48-
4957
== Modifying the quota
5058

51-
Use the PUT command to change the existing quota, in this instance, from 10MB to 100MB:
59+
To change the existing quota, in this instance from 10MB to 100MB, PUT data to the */api/v1/organization/{orgname}/quota/{quota_id}* endpoint:
5260

5361
.Sample command
5462
[source,terminal]
5563
----
56-
$ curl -k -X PUT -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLwwIL" -H 'Content-Type: application/json' -d '{"limit_bytes": 104857600}' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota/1 | jq
64+
$ curl -k -X PUT -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' -d '{"limit_bytes": 104857600}' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota/1 | jq
5765
----
5866

5967
.Sample output
@@ -68,16 +76,10 @@ $ curl -k -X PUT -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLw
6876
}
6977
----
7078

71-
.Organization quota of 100MB
72-
image:quota-100MB-empty.png[100MB quota]
73-
74-
The quota settings are also visible in the organization settings UI:
75-
76-
.Organization settings UI
77-
image:quota-100MB-settings-ui.png[Organization settings UI]
78-
7979
== Pushing images
8080

81+
To see the storage consumed, push various images to the organization.
82+
8183
=== Pushing ubuntu:18.04
8284

8385
.Sample commands
@@ -90,20 +92,15 @@ $ podman tag docker.io/library/ubuntu:18.04 example-registry-quay-quay-enterpris
9092
$ podman push --tls-verify=false example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/testorg/ubuntu:18.04
9193
----
9294

93-
The UI shows the total proportion of the quota used up by this first Ubuntu image:
94-
95-
.Total Quota Consumed for first image
96-
image:quota-first-image.png[Total Quota Consumed for first image]
97-
98-
9995

96+
=== Using the API to view quota usage
10097

101-
=== Using the API to see quota usage
98+
To view the storage consumed, GET data from the */api/v1/repository* endpoint:
10299

103100
.Sample command
104101
[source,terminal]
105102
----
106-
$ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLwwIL" -H 'Content-Type: application/json' 'https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/repository?last_modified=true&namespace=testorg&popularity=true&public=true&quota=true' | jq
103+
$ curl -k -X GET -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' 'https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/repository?last_modified=true&namespace=testorg&popularity=true&public=true&quota=true' | jq
107104
----
108105

109106
.Sample output
@@ -132,7 +129,7 @@ $ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLw
132129

133130
=== Pushing another image
134131

135-
. Pull, tag and push the `nginx` image:
132+
. Pull, tag, and push the `nginx` image:
136133
+
137134
.Sample commands
138135
[source,terminal]
@@ -144,12 +141,12 @@ $ podman tag docker.io/library/nginx example-registry-quay-quay-enterprise.apps.
144141
$ podman push --tls-verify=false example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/testorg/nginx
145142
----
146143

147-
. View the quota report
144+
. To view the quota report for the repositories in the organization, use the */api/v1/repository* endpoint:
148145
+
149146
.Sample command
150147
[source,terminal]
151148
----
152-
$ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLwwIL" -H 'Content-Type: application/json' 'https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/repository?last_modified=true&namespace=testorg&popularity=true&public=true&quota=true'
149+
$ curl -k -X GET -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' 'https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/repository?last_modified=true&namespace=testorg&popularity=true&public=true&quota=true'
153150
----
154151
+
155152
.Sample output
@@ -190,12 +187,13 @@ $ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLw
190187
]
191188
}
192189
----
193-
. View the organization details
190+
191+
. To view the quota information in the organization details, use the */api/v1/organization/{orgname}* endpoint:
194192
+
195193
.Sample command
196194
[source,terminal]
197195
----
198-
$ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLwwIL" -H 'Content-Type: application/json' 'https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg' | jq
196+
$ curl -k -X GET -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' 'https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg' | jq
199197
----
200198
+
201199
.Sample output
@@ -218,33 +216,37 @@ $ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLw
218216
}
219217
----
220218

221-
222-
223-
.Total Quota Consumed for two images
224-
image:quota-second-image.png[Total Quota Consumed for two images]
225-
226219
== Rejecting pushes using quota limits
227220

221+
If an image push exceeds defined quota limitations, a soft or hard check occurs:
222+
223+
* For a soft check, or _warning_, users are notified.
224+
* For a hard check, or _reject_, the push is terminated.
228225

229226
=== Setting reject and warning limits
230227

228+
To set _reject_ and _warning_ limits, POST data to the */api/v1/organization/{orgname}/quota/{quota_id}/limit* endpoint:
229+
231230
.Sample reject limit command
232231
[source,terminal]
233232
----
234-
$ curl -k -X POST -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLwwIL" -H 'Content-Type: application/json' -d '{"type":"Reject","threshold_percent":80}' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota/1/limit
233+
$ curl -k -X POST -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' -d '{"type":"Reject","threshold_percent":80}' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota/1/limit
235234
----
236235

237-
238236
.Sample warning limit command
239237
[source,terminal]
240238
----
241-
$ curl -k -X POST -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLwwIL" -H 'Content-Type: application/json' -d '{"type":"Warning","threshold_percent":50}' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota/1/limit
239+
$ curl -k -X POST -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' -d '{"type":"Warning","threshold_percent":50}' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota/1/limit
242240
----
243241

242+
=== Viewing reject and warning limits
243+
244+
To view the _reject_ and _warning_ limits, use the */api/v1/organization/{orgname}/quota* endpoint:
245+
244246
.View quota limits
245247
[source,terminal]
246248
----
247-
$ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnLwwIL" -H 'Content-Type: application/json' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota | jq
249+
$ curl -k -X GET -H "Authorization: Bearer <token>" -H 'Content-Type: application/json' https://example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/api/v1/organization/testorg/quota | jq
248250
----
249251

250252

@@ -273,11 +275,7 @@ $ curl -k -X GET -H "Authorization: Bearer NspeNNVPobaRjOBSb3WbfZdVtu7ZGSvKoHnL
273275
]
274276
----
275277

276-
.Quota limits in Organization Settings
277-
image:quota-limits.png[Quota limits in Organization Settings]
278-
279-
280-
=== Pushing image when reject limit is exceeded
278+
=== Pushing an image when the reject limit is exceeded
281279

282280
In this example, the reject limit (80%) has been set to below the current repository size (~83%), so the next push should automatically be rejected.
283281

@@ -299,17 +297,17 @@ Getting image source signatures
299297
Copying blob d4dfaa212623 [--------------------------------------] 8.0b / 3.5KiB
300298
Copying blob cba97cc5811c [--------------------------------------] 8.0b / 15.0KiB
301299
Copying blob 0c78fac124da [--------------------------------------] 8.0b / 71.8MiB
302-
WARN[0002] failed, retrying in 1s ... (1/3). Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace
300+
WARN[0002] failed, retrying in 1s ... (1/3). Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace
303301
Getting image source signatures
304302
Copying blob d4dfaa212623 [--------------------------------------] 8.0b / 3.5KiB
305303
Copying blob cba97cc5811c [--------------------------------------] 8.0b / 15.0KiB
306304
Copying blob 0c78fac124da [--------------------------------------] 8.0b / 71.8MiB
307-
WARN[0005] failed, retrying in 1s ... (2/3). Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace
305+
WARN[0005] failed, retrying in 1s ... (2/3). Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace
308306
Getting image source signatures
309307
Copying blob d4dfaa212623 [--------------------------------------] 8.0b / 3.5KiB
310308
Copying blob cba97cc5811c [--------------------------------------] 8.0b / 15.0KiB
311309
Copying blob 0c78fac124da [--------------------------------------] 8.0b / 71.8MiB
312-
WARN[0009] failed, retrying in 1s ... (3/3). Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace
310+
WARN[0009] failed, retrying in 1s ... (3/3). Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace
313311
Getting image source signatures
314312
Copying blob d4dfaa212623 [--------------------------------------] 8.0b / 3.5KiB
315313
Copying blob cba97cc5811c [--------------------------------------] 8.0b / 15.0KiB

0 commit comments

Comments
 (0)