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: i18n/zh/docusaurus-plugin-content-docs/current/userguide/bestpractices/federated-resource-quota.md
+82-35Lines changed: 82 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,52 +1,58 @@
1
1
---
2
-
title: Federated ResourceQuota
2
+
title: 联邦资源配额
3
3
---
4
4
5
-
## Background
5
+
## 背景
6
6
7
-
With the widespread use of multi-clusters, the administrator may deploy services on multiple clusters and resource management of services under multiple clusters has become a new challenge.
8
-
A traditional approach is that the administrator manually deploys a `namespace` and `ResourceQuota` under each Kubernetes cluster, where Kubernetes will limit the resources according to the `ResourceQuotas`.
9
-
This approach is a bit inconvenient and not flexible enough.
10
-
In addition, this practice is now challenged by the differences in service scale, available resources and resource types of each cluster.
Assume you, an administrator, want to deploy service A across multiple clusters in namespace `test`.
34
+
您可以使用 FederatedResourceQuota 来管理CPU、内存、存储和临时存储。
32
35
33
-
You can create a namespace called test on the Karmada control plane. Karmada will automatically create the corresponding namespace in the member clusters.
36
+
## 部署一个简单的 FederatedResourceQuota
37
+
38
+
假设您作为管理员,想在命名空间 `test` 中跨多个集群部署服务 A。
39
+
40
+
您可以在 Karmada 控制平面上创建一个名为 test 的命名空间。Karmada 将自动在成员集群中创建相应的命名空间。
34
41
35
42
```shell
36
43
kubectl --kubeconfig ~/.kube/karmada.config --context karmada-apiserver create ns test
37
44
```
38
45
39
-
You want to create a CPU limit of 100 cores for service A.
40
-
The available resources on clusters:
46
+
您想为服务A 创建 100 核的 CPU 限制。
47
+
集群上的可用资源:
41
48
42
-
* member1: 20C
43
-
* member2: 50C
44
-
* member3: 100C
49
+
* member1:20C
50
+
* member2:50C
51
+
* member3:100C
45
52
46
-
In this example, allocate 20C of member1, 50C of member2, and 30C of member3 to service A.
47
-
Resources are reserved for more important services in member3.
使用前面的示例,假设您想将总体 CPU 限制设置为 100。您需要做的就是定义 `Overall` 限制:
208
+
209
+
```yaml
210
+
apiVersion: policy.karmada.io/v1alpha1
211
+
kind: FederatedResourceQuota
212
+
metadata:
213
+
name: test
214
+
namespace: test
215
+
spec:
216
+
overall:
217
+
cpu: 100
218
+
```
219
+
220
+
一旦应用,Karmada 将开始监控和执行 test 命名空间的 CPU 资源限制。假设您应用了一个需要 20 个 CPU 的新 `Deployment`。联邦资源配额的状态将更新为如下所示:
221
+
222
+
```
223
+
spec:
224
+
overall:
225
+
cpu: 100
226
+
status:
227
+
overall:
228
+
cpu: "100"
229
+
overallUsed:
230
+
cpu: "20"
231
+
```
232
+
233
+
如果您应用的资源超过 100 个CPU的限制,该资源将不会被调度到您的成员集群。
234
+
235
+
:::注意
189
236
190
-
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