Skip to content

Commit 06b02fb

Browse files
authored
Merge pull request #42290 from my-git9/manage-resources1
[zh-cn] sync manage-resources/* adn encrypt-data
2 parents 40f6e39 + cb6ee2c commit 06b02fb

File tree

7 files changed

+72
-41
lines changed

7 files changed

+72
-41
lines changed

content/zh-cn/docs/tasks/administer-cluster/encrypt-data.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,46 @@ weight: 210
1313
-->
1414

1515
<!-- overview -->
16+
17+
<!--
18+
All of the APIs in Kubernetes that let you write persistent API resource data support
19+
at-rest encryption. For example, you can enable at-rest encryption for
20+
{{< glossary_tooltip text="Secrets" term_id="secret" >}}.
21+
This at-rest encryption is additional to any system-level encryption for the
22+
etcd cluster or for the filesystem(s) on hosts where you are running the
23+
kube-apiserver.
24+
25+
This page shows how to enable and configure encryption of API data at rest.
26+
-->
27+
Kubernetes 中允许允许用户编辑的持久 API 资源数据的所有 API 都支持静态加密。
28+
例如,你可以启用静态加密 {{< glossary_tooltip text="Secret" term_id="secret" >}}。
29+
此静态加密是对 etcd 集群或运行 kube-apiserver 的主机上的文件系统的任何系统级加密的补充。
30+
31+
本页展示如何启用和配置静态 API 数据加密。
32+
33+
{{< note >}}
1634
<!--
17-
This page shows how to enable and configure encryption of secret data at rest.
35+
This task covers encryption for resource data stored using the
36+
{{< glossary_tooltip text="Kubernetes API" term_id="kubernetes-api" >}}. For example, you can
37+
encrypt Secret objects, including the key-value data they contain.
1838
-->
19-
本文展示如何启用和配置静态 Secret 数据的加密。
39+
此任务涵盖使用 {{< glossary_tooltip text="Kubernetes API" term_id="kubernetes-api" >}}
40+
存储的资源数据的加密。
41+
例如,你可以加密 Secret 对象,包括它们包含的键值数据。
42+
<!--
43+
If you want to encrypt data in filesystems that are mounted into containers, you instead need
44+
to either:
45+
46+
- use a storage integration that provides encrypted
47+
{{< glossary_tooltip text="volumes" term_id="volume" >}}
48+
- encrypt the data within your own application
49+
-->
50+
如果要加密安装到容器中的文件系统中的数据,则需要:
51+
52+
- 使用提供加密 {{< glossary_tooltip text="volumes" term_id="volume" >}} 的存储集成
53+
- 在你自己的应用程序中加密数据
54+
55+
{{< /note >}}
2056

2157
## {{% heading "prerequisites" %}}
2258

content/zh-cn/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ Here's a manifest for an example {{< glossary_tooltip text="LimitRange" term_id=
7474

7575
以下为 {{< glossary_tooltip text="LimitRange" term_id="limitrange" >}} 的示例清单:
7676

77-
{{< codenew file="admin/resource/cpu-constraints.yaml" >}}
77+
{{% codenew file="admin/resource/cpu-constraints.yaml" %}}
7878

7979
<!--
8080
Create the LimitRange:
8181
-->
82-
创建 LimitRange:
82+
创建 LimitRange
8383

8484
```shell
8585
kubectl apply -f https://k8s.io/examples/admin/resource/cpu-constraints.yaml --namespace=constraints-cpu-example
@@ -152,10 +152,10 @@ specifies a CPU request of 500 millicpu and a CPU limit of 800 millicpu. These s
152152
minimum and maximum CPU constraints imposed by the LimitRange for this namespace.
153153
-->
154154
以下为某个仅包含一个容器的 Pod 的清单。
155-
该容器声明了 CPU 请求 500 millicpu 和 CPU 限制 800 millicpu
155+
该容器声明了 CPU 请求 500 millicpu 和 CPU 限制 800 millicpu。
156156
这些参数满足了 LimitRange 对象为此名字空间规定的 CPU 最小和最大限制。
157157

158-
{{< codenew file="admin/resource/cpu-constraints-pod.yaml" >}}
158+
{{% codenew file="admin/resource/cpu-constraints-pod.yaml" %}}
159159

160160
<!--
161161
Create the Pod:
@@ -219,7 +219,7 @@ CPU request of 500 millicpu and a cpu limit of 1.5 cpu.
219219
这里给出了包含一个容器的 Pod 清单。容器声明了 500 millicpu 的 CPU
220220
请求和 1.5 CPU 的 CPU 限制。
221221

222-
{{< codenew file="admin/resource/cpu-constraints-pod-2.yaml" >}}
222+
{{% codenew file="admin/resource/cpu-constraints-pod-2.yaml" %}}
223223

224224
<!--
225225
Attempt to create the Pod:
@@ -252,7 +252,7 @@ CPU request of 100 millicpu and a CPU limit of 800 millicpu.
252252
253253
以下为某个只有一个容器的 Pod 的清单。该容器声明了 CPU 请求 100 millicpu 和 CPU 限制 800 millicpu。
254254
255-
{{< codenew file="admin/resource/cpu-constraints-pod-3.yaml" >}}
255+
{{% codenew file="admin/resource/cpu-constraints-pod-3.yaml" %}}
256256
257257
<!--
258258
Attempt to create the Pod:
@@ -286,7 +286,7 @@ specify a CPU request, nor does it specify a CPU limit.
286286

287287
以下为一个只有一个容器的 Pod 的清单。该容器没有声明 CPU 请求,也没有声明 CPU 限制。
288288

289-
{{< codenew file="admin/resource/cpu-constraints-pod-4.yaml" >}}
289+
{{% codenew file="admin/resource/cpu-constraints-pod-4.yaml" %}}
290290

291291
<!--
292292
Create the Pod:
@@ -421,7 +421,7 @@ kubectl delete namespace constraints-cpu-example
421421
* [Configure Quotas for API Objects](/docs/tasks/administer-cluster/quota-api-object/)
422422
-->
423423

424-
### 集群管理员参考
424+
### 集群管理员参考
425425

426426
* [为命名空间配置默认内存请求和限制](/zh-cn/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/)
427427
* [为命名空间配置默认 CPU 请求和限制](/zh-cn/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace/)
@@ -438,9 +438,8 @@ kubectl delete namespace constraints-cpu-example
438438
* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)
439439
-->
440440

441-
### 应用开发者参考
441+
### 应用开发者参考
442442

443443
* [为容器和 Pod 分配内存资源](/zh-cn/docs/tasks/configure-pod-container/assign-memory-resource/)
444444
* [为容器和 Pod 分配 CPU 资源](/zh-cn/docs/tasks/configure-pod-container/assign-cpu-resource/)
445445
* [为 Pod 配置服务质量](/zh-cn/docs/tasks/configure-pod-container/quality-service-pod/)
446-

content/zh-cn/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ CPU limit to that container.
2727
Kubernetes assigns a default CPU
2828
[request](/docs/concepts/configuration/manage-resources-containers/#requests-and-limits),
2929
but only under certain conditions that are explained later in this page.
30-
3130
-->
3231
本章介绍如何为{{< glossary_tooltip text="命名空间" term_id="namespace" >}}配置默认的 CPU 请求和限制。
3332

3433
一个 Kubernetes 集群可被划分为多个命名空间。
35-
如果你在具有默认 CPU[限制](/zh-cn/docs/concepts/configuration/manage-resources-containers/#requests-and-limits)
34+
如果你在具有默认 CPU [限制](/zh-cn/docs/concepts/configuration/manage-resources-containers/#requests-and-limits)
3635
的命名空间内创建一个 Pod,并且这个 Pod 中任何容器都没有声明自己的 CPU 限制,
3736
那么{{< glossary_tooltip text="控制面" term_id="control-plane" >}}会为容器设定默认的 CPU 限制。
3837

@@ -80,7 +79,7 @@ The manifest specifies a default CPU request and a default CPU limit.
8079
以下为 {{< glossary_tooltip text="LimitRange" term_id="limitrange" >}} 的示例清单。
8180
清单中声明了默认 CPU 请求和默认 CPU 限制。
8281

83-
{{< codenew file="admin/resource/cpu-defaults.yaml" >}}
82+
{{% codenew file="admin/resource/cpu-defaults.yaml" %}}
8483

8584
<!--
8685
Create the LimitRange in the default-cpu-example namespace:
@@ -106,7 +105,7 @@ does not specify a CPU request and limit.
106105

107106
以下为只包含一个容器的 Pod 的清单。该容器没有声明 CPU 请求和限制。
108107

109-
{{< codenew file="admin/resource/cpu-defaults-pod.yaml" >}}
108+
{{% codenew file="admin/resource/cpu-defaults-pod.yaml" %}}
110109

111110
<!--
112111
Create the Pod.
@@ -156,12 +155,12 @@ specifies a CPU limit, but not a request:
156155

157156
以下为只包含一个容器的 Pod 的清单。该容器声明了 CPU 限制,而没有声明 CPU 请求。
158157

159-
{{< codenew file="admin/resource/cpu-defaults-pod-2.yaml" >}}
158+
{{% codenew file="admin/resource/cpu-defaults-pod-2.yaml" %}}
160159

161160
<!--
162161
Create the Pod:
163162
-->
164-
创建 Pod
163+
创建 Pod
165164

166165
```shell
167166
kubectl apply -f https://k8s.io/examples/admin/resource/cpu-defaults-pod-2.yaml --namespace=default-cpu-example
@@ -201,7 +200,7 @@ specifies a CPU request, but not a limit:
201200

202201
这里给出了包含一个容器的 Pod 的示例清单。该容器声明了 CPU 请求,而没有声明 CPU 限制。
203202

204-
{{< codenew file="admin/resource/cpu-defaults-pod-3.yaml" >}}
203+
{{% codenew file="admin/resource/cpu-defaults-pod-3.yaml" %}}
205204

206205
<!--
207206
Create the Pod:
@@ -250,7 +249,6 @@ Here are two of the restrictions that a CPU resource quota imposes on a namespac
250249
* CPU limits apply a resource reservation on the node where the Pod in question is scheduled.
251250
The total amount of CPU that is reserved for use by all Pods in the namespace must not
252251
exceed a specified limit.
253-
254252
-->
255253
## 默认 CPU 限制和请求的动机
256254

content/zh-cn/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ Here's an example manifest for a LimitRange:
6666

6767
下面是 LimitRange 的示例清单:
6868

69-
{{< codenew file="admin/resource/memory-constraints.yaml" >}}
69+
{{% codenew file="admin/resource/memory-constraints.yaml" %}}
7070

7171
<!--
7272
Create the LimitRange:
7373
-->
74-
创建 LimitRange:
74+
创建 LimitRange
7575

7676
```shell
7777
kubectl apply -f https://k8s.io/examples/admin/resource/memory-constraints.yaml --namespace=constraints-mem-example
@@ -132,7 +132,7 @@ minimum and maximum memory constraints imposed by the LimitRange.
132132
以下为包含一个容器的 Pod 清单。该容器声明了 600 MiB 的内存请求和 800 MiB 的内存限制,
133133
这些满足了 LimitRange 施加的最小和最大内存约束。
134134

135-
{{< codenew file="admin/resource/memory-constraints-pod.yaml" >}}
135+
{{% codenew file="admin/resource/memory-constraints-pod.yaml" %}}
136136

137137
<!--
138138
Create the Pod:
@@ -196,12 +196,12 @@ memory request of 800 MiB and a memory limit of 1.5 GiB.
196196

197197
以下为包含一个容器的 Pod 的清单。这个容器声明了 800 MiB 的内存请求和 1.5 GiB 的内存限制。
198198

199-
{{< codenew file="admin/resource/memory-constraints-pod-2.yaml" >}}
199+
{{% codenew file="admin/resource/memory-constraints-pod-2.yaml" %}}
200200

201201
<!--
202202
Attempt to create the Pod:
203203
-->
204-
尝试创建 Pod:
204+
尝试创建 Pod
205205

206206
```shell
207207
kubectl apply -f https://k8s.io/examples/admin/resource/memory-constraints-pod-2.yaml --namespace=constraints-mem-example
@@ -228,7 +228,7 @@ memory request of 100 MiB and a memory limit of 800 MiB.
228228

229229
以下为只有一个容器的 Pod 的清单。这个容器声明了 100 MiB 的内存请求和 800 MiB 的内存限制。
230230

231-
{{< codenew file="admin/resource/memory-constraints-pod-3.yaml" >}}
231+
{{% codenew file="admin/resource/memory-constraints-pod-3.yaml" %}}
232232

233233
<!--
234234
Attempt to create the Pod:
@@ -260,7 +260,7 @@ specify a memory request, and it does not specify a memory limit.
260260

261261
以下为只有一个容器的 Pod 清单。该容器没有声明内存请求,也没有声明内存限制。
262262

263-
{{< codenew file="admin/resource/memory-constraints-pod-4.yaml" >}}
263+
{{% codenew file="admin/resource/memory-constraints-pod-4.yaml" %}}
264264

265265
<!--
266266
Create the Pod:
@@ -423,4 +423,3 @@ kubectl delete namespace constraints-mem-example
423423
* [为容器和 Pod 分配内存资源](/zh-cn/docs/tasks/configure-pod-container/assign-memory-resource/)
424424
* [为容器和 Pod 分配 CPU 资源](/zh-cn/docs/tasks/configure-pod-container/assign-cpu-resource/)
425425
* [为 Pod 配置服务质量](/zh-cn/docs/tasks/configure-pod-container/quality-service-pod/)
426-

content/zh-cn/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ request and a default memory limit.
8181
以下为 {{< glossary_tooltip text="LimitRange" term_id="limitrange" >}} 的示例清单。
8282
清单中声明了默认的内存请求和默认的内存限制。
8383

84-
{{< codenew file="admin/resource/memory-defaults.yaml" >}}
84+
{{% codenew file="admin/resource/memory-defaults.yaml" %}}
8585

8686
<!--
8787
Create the LimitRange in the default-mem-example namespace:
@@ -108,7 +108,7 @@ does not specify a memory request and limit.
108108

109109
以下为只包含一个容器的 Pod 的清单。该容器没有声明内存请求和限制。
110110

111-
{{< codenew file="admin/resource/memory-defaults-pod.yaml" >}}
111+
{{% codenew file="admin/resource/memory-defaults-pod.yaml" %}}
112112

113113
<!--
114114
Create the Pod.
@@ -166,7 +166,7 @@ specifies a memory limit, but not a request:
166166

167167
以下为只包含一个容器的 Pod 的清单。该容器声明了内存限制,而没有声明内存请求。
168168

169-
{{< codenew file="admin/resource/memory-defaults-pod-2.yaml" >}}
169+
{{% codenew file="admin/resource/memory-defaults-pod-2.yaml" %}}
170170

171171
<!--
172172
Create the Pod:
@@ -211,7 +211,7 @@ specifies a memory request, but not a limit:
211211
-->
212212
以下为只包含一个容器的 Pod 的清单。该容器声明了内存请求,但没有内存限制:
213213

214-
{{< codenew file="admin/resource/memory-defaults-pod-3.yaml" >}}
214+
{{% codenew file="admin/resource/memory-defaults-pod-3.yaml" %}}
215215

216216
<!--
217217
Create the Pod:
@@ -253,8 +253,8 @@ resources:
253253
A `LimitRange` does **not** check the consistency of the default values it applies. This means that a default value for the _limit_ that is set by `LimitRange` may be less than the _request_ value specified for the container in the spec that a client submits to the API server. If that happens, the final Pod will not be scheduleable.
254254
See [Constraints on resource limits and requests](/docs/concepts/policy/limit-range/#constraints-on-resource-limits-and-requests) for more details.
255255
-->
256-
`LimitRange` **不会**检查它应用的默认值的一致性。 这意味着 `LimitRange` 设置的 _limit_ 的默认值可能小于客户端提交给
257-
API 服务器的声明中为容器指定的 _request_ 值。如果发生这种情况,最终会导致 Pod 无法调度。更多信息,
256+
`LimitRange` **不会**检查它应用的默认值的一致性。 这意味着 `LimitRange` 设置的 **limit** 的默认值可能小于客户端提交给
257+
API 服务器的声明中为容器指定的 **request** 值。如果发生这种情况,最终会导致 Pod 无法调度。更多信息,
258258
请参阅[资源限制的 limit 和 request](/zh-cn/docs/concepts/policy/limit-range/#constraints-on-resource-limits-and-requests)
259259

260260
{{< /note >}}
@@ -355,4 +355,3 @@ kubectl delete namespace default-mem-example
355355
* [为容器和 Pod 分配内存资源](/zh-cn/docs/tasks/configure-pod-container/assign-memory-resource/)
356356
* [为容器和 Pod 分配 CPU 资源](/zh-cn/docs/tasks/configure-pod-container/assign-cpu-resource/)
357357
* [为 Pod 配置服务质量](/zh-cn/docs/tasks/configure-pod-container/quality-service-pod/)
358-

content/zh-cn/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Here is a manifest for an example ResourceQuota:
6565

6666
下面是 ResourceQuota 的示例清单:
6767

68-
{{< codenew file="admin/resource/quota-mem-cpu.yaml" >}}
68+
{{% codenew file="admin/resource/quota-mem-cpu.yaml" %}}
6969

7070
<!--
7171
Create the ResourceQuota:
@@ -116,7 +116,7 @@ Here is a manifest for an example Pod:
116116

117117
以下是 Pod 的示例清单:
118118

119-
{{< codenew file="admin/resource/quota-mem-cpu-pod.yaml" >}}
119+
{{% codenew file="admin/resource/quota-mem-cpu-pod.yaml" %}}
120120

121121
<!--
122122
Create the Pod:
@@ -186,7 +186,7 @@ Here is a manifest for a second Pod:
186186

187187
以下为第二个 Pod 的清单:
188188

189-
{{< codenew file="admin/resource/quota-mem-cpu-pod-2.yaml" >}}
189+
{{% codenew file="admin/resource/quota-mem-cpu-pod-2.yaml" %}}
190190

191191
<!--
192192
In the manifest, you can see that the Pod has a memory request of 700 MiB.

content/zh-cn/docs/tasks/administer-cluster/manage-resources/quota-pod-namespace.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Here is an example manifest for a ResourceQuota:
6161

6262
下面是 ResourceQuota 的示例清单:
6363

64-
{{< codenew file="admin/resource/quota-pod.yaml" >}}
64+
{{% codenew file="admin/resource/quota-pod.yaml" %}}
6565

6666
<!--
6767
Create the ResourceQuota:
@@ -104,7 +104,7 @@ Here is an example manifest for a {{< glossary_tooltip term_id="deployment" >}}:
104104
-->
105105
下面是一个 {{< glossary_tooltip term_id="deployment" >}} 的示例清单:
106106
107-
{{< codenew file="admin/resource/quota-pod-deployment.yaml" >}}
107+
{{% codenew file="admin/resource/quota-pod-deployment.yaml" %}}
108108
109109
<!--
110110
In that manifest, `replicas: 3` tells Kubernetes to attempt to create three new Pods, all
@@ -161,7 +161,7 @@ that can live in a single namespace.
161161
### 资源的选择 {#choice-of-resource}
162162
在此任务中,你定义了一个限制 Pod 总数的 ResourceQuota,
163163
你也可以限制其他类型对象的总数。
164-
例如,你可以限制在一个命名空间中可以创建的 {{< glossary_tooltip text="CronJobs" term_id="cronjob" >}} 的数量。
164+
例如,你可以限制在一个命名空间中可以创建的 {{< glossary_tooltip text="CronJob" term_id="cronjob" >}} 的数量。
165165

166166
<!--
167167
## Clean up

0 commit comments

Comments
 (0)