Skip to content

Commit 8eb8a04

Browse files
authored
Merge pull request #835 from mszacillo/main
Adding documentation for resource quota enforcement feature
2 parents c75e433 + d5b6659 commit 8eb8a04

2 files changed

Lines changed: 56 additions & 6 deletions

File tree

350 KB
Loading

docs/userguide/bestpractices/federated-resource-quota.md

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,22 @@ Here's where the `FederatedResourceQuota` API comes in. The following is several
1616

1717
FederatedResourceQuota supports:
1818

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.
2424

2525
![unified resourcequota](../../resources/key-features/unified-resourcequota.png)
2626

27+
2. **Karmada Control Plane-Level Quota Enforcement**
28+
* Enables enforcement of namespaced resource limits at the federated level, not just per-cluster.
29+
* Centralized quota checks:
30+
* Resource creation and updates against Karmada control-plane
31+
* Prevents overcommitment by rejecting scheduling requests that would exceed the aggregate quota for the namespace
32+
33+
![federated quota enforcement](../../resources/key-features/federated-quota-enforcement.png)
34+
2735
You can use FederatedResourceQuota to manage CPU, memory, storage and ephemeral-storage.
2836

2937
## Deploy a simplest FederatedResourceQuota
@@ -185,8 +193,50 @@ status:
185193
cpu: "1"
186194
```
187195

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+
188238
:::note
189239
190240
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.
191241
192-
:::
242+
:::

0 commit comments

Comments
 (0)