You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/userguide/bestpractices/federated-resource-quota.md
+56-6Lines changed: 56 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,14 +16,22 @@ Here's where the `FederatedResourceQuota` API comes in. The following is several
16
16
17
17
FederatedResourceQuota supports:
18
18
19
-
* Global quota management for applications that run on multiple clusters.
20
-
* Fine-grained management of quotas under the same namespace of different clusters.
21
-
* Ability to enumerate resource usage limits per namespace.
22
-
* Ability to monitor resource usage for tracked resources.
23
-
* Ability to reject resource usage exceeding hard quotas.
19
+
1.**ResourceQuota Management**
20
+
* Set and track overall quota usage for federated applications deployed across clusters. Also supports fine-grained management of quotas under the same namespace of different clusters with:
21
+
* Ability to enumerate resource usage limits per namespace.
22
+
* Ability to monitor resource usage for tracked resources.
23
+
* Ability to reject resource usage exceeding hard quotas.
You can use FederatedResourceQuota to manage CPU, memory, storage and ephemeral-storage.
28
36
29
37
## Deploy a simplest FederatedResourceQuota
@@ -185,8 +193,50 @@ status:
185
193
cpu: "1"
186
194
```
187
195
196
+
## Using FederatedResourceQuota enforcement
197
+
198
+
:::note
199
+
200
+
FederatedResourceQuota enforcement is a new feature. This capability requires enabling the `FederatedQuotaEnforcement` feature gate. FederatedQuotaEnforcement is currently in Alpha and is turned off by default.
201
+
202
+
:::
203
+
204
+
The FederatedResourceQuota's base feature allows user to schedule ResourceQuotas that can control overall resource limits across many clusters using `staticAssignment`. However, you can also use the FederatedResourceQuota to impose and enforce resource limits directly against the Karmada control-plane.
205
+
206
+
This can be especially useful if:
207
+
* You need to track resource consumption and limits from a unified place
208
+
* You would like to prevent unnecessary scheduling to clusters by verifying quota resource limits
209
+
210
+
Using the previous spec as an example, let's assume you want to set the overall cpu limit to 100. All you would need to do is define the `Overall` limits:
211
+
212
+
```yaml
213
+
apiVersion: policy.karmada.io/v1alpha1
214
+
kind: FederatedResourceQuota
215
+
metadata:
216
+
name: test
217
+
namespace: test
218
+
spec:
219
+
overall:
220
+
cpu: 100
221
+
```
222
+
223
+
Once applied, Karmada will begin monitoring and enforcing the cpu resource limit for the test namespace. Let's assume you apply a new `Deployment` that has a requirement of 20 CPU. The status of the FederatedResourceQuota will be updated to look like the following:
224
+
225
+
```
226
+
spec:
227
+
overall:
228
+
cpu: 100
229
+
status:
230
+
overall:
231
+
cpu: "100"
232
+
overallUsed:
233
+
cpu: "20"
234
+
```
235
+
236
+
If you apply a resource that goes above the limit of 100 CPU, the resource will not be scheduled to your member clusters.
237
+
188
238
:::note
189
239
190
240
FederatedResourceQuota is still a work in progress. We are in the progress of gathering use cases. If you are interested in this feature, please feel free to start an enhancement issue to let us know.
0 commit comments