Skip to content

Commit 32d5730

Browse files
committed
translate federated-resource-quota.md to Chinese
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
1 parent 59917b0 commit 32d5730

2 files changed

Lines changed: 82 additions & 35 deletions

File tree

350 KB
Loading

i18n/zh/docusaurus-plugin-content-docs/current/userguide/bestpractices/federated-resource-quota.md

Lines changed: 82 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,58 @@
11
---
2-
title: Federated ResourceQuota
2+
title: 联邦资源配额
33
---
44

5-
## Background
5+
## 背景
66

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.
7+
随着多集群的广泛使用,管理员可能会在多个集群上部署服务,而多个集群下服务的资源管理已成为新的挑战。
8+
传统方法是管理员在每个 Kubernetes 集群下手动部署一个命名空间和 `ResourceQuota`Kubernetes 将根据 `ResourceQuotas` 限制此命名空间下的资源。
9+
这种方法有点不方便,也不够灵活。
10+
此外,多集群场景下此类方法也面临着每个集群的服务规模、可用资源和资源类型差异的挑战。
1111

12-
Resource administrators often need to manage and control the consumption of resources by each service in a global view.
13-
Here's where the `FederatedResourceQuota` API comes in. The following is several typical usage scenarios of `FederatedResourceQuota`.
12+
资源管理员通常需要从全局视角管理和控制每个服务的资源消耗。这就是 `FederatedResourceQuota` API 的用武之地。以下是`FederatedResourceQuota`的几个典型使用场景。
1413

15-
## What FederatedResourceQuota can do
14+
## FederatedResourceQuota 能做什么
1615

17-
FederatedResourceQuota supports:
16+
FederatedResourceQuota 支持:
1817

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.
18+
1. **资源配额管理**
19+
* 设置和跟踪跨集群部署的联邦应用程序的总体配额使用情况。还支持对不同集群的相同命名空间下的配额进行细粒度管理,包括:
20+
* 枚举每个命名空间的资源使用限制的能力。
21+
* 监控跟踪资源的资源使用情况的能力。
22+
* 拒绝超过硬配额的资源使用的能力。
2423

25-
![unified resourcequota](../../resources/key-features/unified-resourcequota.png)
24+
![统一资源配额](../../resources/key-features/unified-resourcequota.png)
2625

27-
You can use FederatedResourceQuota to manage CPU, memory, storage and ephemeral-storage.
26+
2. **Karmada 控制面级别的配额管理**
27+
* 支持在联邦级别而不仅仅是每个集群执行命名空间资源限制。
28+
* 集中配额检查:
29+
* 针对Karmada控制平面的资源创建和更新
30+
* 通过拒绝会超过命名空间总配额的调度请求来防止过度调度。
2831

29-
## Deploy a simplest FederatedResourceQuota
32+
![控制面级别的配额管理](../../resources/key-features/federated-quota-enforcement.png)
3033

31-
Assume you, an administrator, want to deploy service A across multiple clusters in namespace `test`.
34+
您可以使用 FederatedResourceQuota 来管理CPU、内存、存储和临时存储。
3235

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 将自动在成员集群中创建相应的命名空间。
3441

3542
```shell
3643
kubectl --kubeconfig ~/.kube/karmada.config --context karmada-apiserver create ns test
3744
```
3845

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+
集群上的可用资源:
4148

42-
* member1: 20C
43-
* member2: 50C
44-
* member3: 100C
49+
* member120C
50+
* member250C
51+
* member3100C
4552

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.
53+
在此示例中,将 member1 的 20C、member2 的 50C 和 member3 的 30C 分配给服务A。为 member3 中的更重要服务保留资源。
4854

49-
You can deploy a FederatedResourceQuota as follows.
55+
您可以按如下方式部署 FederatedResourceQuota
5056

5157
```yaml
5258
apiVersion: policy.karmada.io/v1alpha1
@@ -69,14 +75,13 @@ spec:
6975
cpu: 30
7076
```
7177
72-
Verify the status of FederatedResourceQuota:
78+
验证 FederatedResourceQuota 的状态:
7379
7480
```shell
7581
kubectl --kubeconfig ~/.kube/karmada.config --context karmada-apiserver get federatedresourcequotas/test -ntest -oyaml
7682
```
7783

78-
The output is similar to:
79-
84+
输出类似于:
8085
```
8186
spec:
8287
overall:
@@ -114,7 +119,7 @@ status:
114119
cpu: "0"
115120
```
116121

117-
For quick test, you can deploy a simple application which consumes 1C CPU to member1.
122+
为了快速测试,您可以部署一个消耗 1C CPU 的简单应用程序到 member1
118123

119124
```shell
120125
apiVersion: apps/v1
@@ -142,7 +147,7 @@ spec:
142147
cpu: 1
143148
```
144149

145-
Verify the status of FederatedResourceQuota and you will find that FederatedResourceQuota can monitor resource usage correctly for tracked resources.
150+
验证 FederatedResourceQuota 的状态,您会发现 FederatedResourceQuota 可以正确监控跟踪资源的资源使用情况。
146151

147152
```shell
148153
kubectl --kubeconfig ~/.kube/karmada.config --context karmada-apiserver get federatedresourcequotas/test -ntest -oyaml
@@ -185,8 +190,50 @@ status:
185190
cpu: "1"
186191
```
187192

188-
:::note
193+
## 使用控制面级别的配额管理
194+
195+
:::注意
196+
197+
控制面级别的配额管理是一项新功能。此功能需要启用`FederatedQuotaEnforcement`特性门控。目前处于Alpha阶段,默认情况下是关闭的。
198+
199+
:::
200+
201+
FederatedResourceQuota 的基本功能允许用户使用 `staticAssignment` 控制跨多个集群的总体资源限制的资源配额。但是,您也可以使用 FederatedResourceQuota 直接对 Karmada 控制平面施加和执行资源限制。
202+
203+
这在以下情况下尤其有用:
204+
- 您需要从统一的位置跟踪资源消耗和限制
205+
- 您希望通过限制配额资源来防止不必要地调度资源到成员集群
206+
207+
使用前面的示例,假设您想将总体 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+
:::注意
189236
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.
237+
联邦资源配额仍在开发中。我们正在收集用例。如果您对此功能感兴趣,请随时发起 enhancement issue 让我们知道。
191238
192239
:::

0 commit comments

Comments
 (0)