Skip to content

Commit 7eada7c

Browse files
authored
Merge pull request #41207 from windsonsea/encryd
[zh] sync encrypt-data.md and safely-drain-node.md
2 parents f64ccd9 + 6d1e72a commit 7eada7c

File tree

2 files changed

+72
-34
lines changed

2 files changed

+72
-34
lines changed

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

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,13 @@ This page shows how to enable and configure encryption of secret data at rest.
5454
The `kube-apiserver` process accepts an argument `--encryption-provider-config`
5555
that controls how API data is encrypted in etcd.
5656
The configuration is provided as an API named
57-
[`EncryptionConfiguration`](/docs/reference/config-api/apiserver-encryption.v1/). `--encryption-provider-config-automatic-reload` boolean argument determines if the file set by `--encryption-provider-config` should be automatically reloaded if the disk contents change. This enables key rotation without API server restarts. An example configuration is provided below.
57+
[`EncryptionConfiguration`](/docs/reference/config-api/apiserver-encryption.v1/). An example configuration is provided below.
5858
-->
5959
## 配置并确定是否已启用静态数据加密 {#configuration-and-determing-wheter-encryption-at-rest-is-already-enabled}
6060

6161
`kube-apiserver` 的参数 `--encryption-provider-config` 控制 API 数据在 etcd 中的加密方式。
62-
该配置作为一个名为 [`EncryptionConfiguration`](/zh-cn/docs/reference/config-api/apiserver-encryption.v1/) 的 API 提供。
63-
`--encryption-provider-config-automatic-reload` 布尔参数决定了磁盘内容发生变化时是否应自动重新加载
64-
`--encryption-provider-config` 设置的文件。这样可以在不重启 API 服务器的情况下进行密钥轮换。
65-
66-
下面提供了一个示例配置。
62+
该配置作为一个名为 [`EncryptionConfiguration`](/zh-cn/docs/reference/config-api/apiserver-encryption.v1/)
63+
的 API 提供。下面提供了一个示例配置。
6764

6865
{{< caution >}}
6966
<!--
@@ -501,19 +498,19 @@ To create a new Secret, perform the following steps:
501498
- command:
502499
- kube-apiserver
503500
...
504-
- --encryption-provider-config=/etc/kubernetes/enc/enc.yaml # <-- 增加这一行
501+
- --encryption-provider-config=/etc/kubernetes/enc/enc.yaml # 增加这一行
505502
volumeMounts:
506503
...
507-
- name: enc # <-- 增加这一行
508-
mountPath: /etc/kubernetes/enc # <-- 增加这一行
509-
readonly: true # <-- 增加这一行
504+
- name: enc # 增加这一行
505+
mountPath: /etc/kubernetes/enc # 增加这一行
506+
readonly: true # 增加这一行
510507
...
511508
volumes:
512509
...
513-
- name: enc # <-- 增加这一行
514-
hostPath: # <-- 增加这一行
515-
path: /etc/kubernetes/enc # <-- 增加这一行
516-
type: DirectoryOrCreate # <-- 增加这一行
510+
- name: enc # 增加这一行
511+
hostPath: # 增加这一行
512+
path: /etc/kubernetes/enc # 增加这一行
513+
type: DirectoryOrCreate # 增加这一行
517514
...
518515
```
519516

@@ -719,6 +716,33 @@ Then run the following command to force decrypt all Secrets:
719716
kubectl get secrets --all-namespaces -o json | kubectl replace -f -
720717
```
721718

719+
<!--
720+
## Configure automatic reloading
721+
-->
722+
## 配置自动重新加载 {#configure-automatic-reloading}
723+
724+
<!--
725+
You can configure automatic reloading of encryption provider configuration.
726+
That setting determines whether the
727+
{{< glossary_tooltip text="API server" term_id="kube-apiserver" >}} should
728+
load the file you specify for `--encryption-provider-config` only once at
729+
startup, or automatically whenever you change that file. Enabling this option
730+
allows you to change the keys for encryption at rest without restarting the
731+
API server.
732+
-->
733+
你可以配置加密提供程序配置的自动重新加载。
734+
该设置决定了 {{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}}
735+
是仅在启动时加载一次为 `--encryption-provider-config` 指定的文件,
736+
还是在每次你更改该文件时都自动加载。
737+
启用此选项可允许你在不重启 API 服务器的情况下更改静态加密所需的密钥。
738+
739+
<!--
740+
To allow automatic reloading, configure the API server to run with:
741+
`--encryption-provider-config-automatic-reload=true`
742+
-->
743+
要允许自动重新加载,
744+
可使用 `--encryption-provider-config-automatic-reload=true` 运行 API 服务器。
745+
722746
## {{% heading "whatsnext" %}}
723747

724748
<!--

content/zh-cn/docs/tasks/administer-cluster/safely-drain-node.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: 安全地清空一个节点
33
content_type: task
4-
min-kubernetes-server-version: 1.5
54
weight: 310
65
---
76
<!--
@@ -12,7 +11,6 @@ reviewers:
1211
- kow3ns
1312
title: Safely Drain a Node
1413
content_type: task
15-
min-kubernetes-server-version: 1.5
1614
weight: 310
1715
-->
1816

@@ -25,25 +23,20 @@ This page shows how to safely drain a node, respecting the PodDisruptionBudget y
2523

2624
## {{% heading "prerequisites" %}}
2725

28-
{{% version-check %}}
2926
<!--
3027
This task assumes that you have met the following prerequisites:
3128
32-
* You are using Kubernetes release >= 1.5.
33-
* Either:
34-
1. You do not require your applications to be highly available during the
35-
node drain, or
36-
2. You have read about the [PodDisruptionBudget concept](/docs/concepts/workloads/pods/disruptions/)
37-
and [Configured PodDisruptionBudgets](/docs/tasks/run-application/configure-pdb/) for
38-
applications that need them.
29+
1. You do not require your applications to be highly available during the
30+
node drain, or
31+
1. You have read about the [PodDisruptionBudget](/docs/concepts/workloads/pods/disruptions/) concept,
32+
and have [configured PodDisruptionBudgets](/docs/tasks/run-application/configure-pdb/) for
33+
applications that need them.
3934
-->
4035
此任务假定你已经满足了以下先决条件:
4136

42-
* 使用的 Kubernetes 版本 >= 1.5。
43-
* 以下两项,具备其一:
44-
1. 在节点清空期间,不要求应用程序具有高可用性
45-
2. 你已经了解了 [PodDisruptionBudget 的概念](/zh-cn/docs/concepts/workloads/pods/disruptions/)
46-
并为需要它的应用程序[配置了 PodDisruptionBudget](/zh-cn/docs/tasks/run-application/configure-pdb/)
37+
1. 在节点清空期间,不要求应用具有高可用性
38+
2. 你已经了解了 [PodDisruptionBudget 的概念](/zh-cn/docs/concepts/workloads/pods/disruptions/)
39+
并为需要它的应用[配置了 PodDisruptionBudget](/zh-cn/docs/tasks/run-application/configure-pdb/)
4740

4841
<!-- steps -->
4942

@@ -110,14 +103,35 @@ have been safely evicted (respecting the desired graceful termination period,
110103
and respecting the PodDisruptionBudget you have defined). It is then safe to
111104
bring down the node by powering down its physical machine or, if running on a
112105
cloud platform, deleting its virtual machine.
113-
114-
First, identify the name of the node you wish to drain. You can list all of the nodes in your cluster with
115106
-->
116107
`kubectl drain` 的成功返回,表明所有的 Pod(除了上一段中描述的被排除的那些),
117108
已经被安全地逐出(考虑到期望的终止宽限期和你定义的 PodDisruptionBudget)。
118109
然后就可以安全地关闭节点,
119110
比如关闭物理机器的电源,如果它运行在云平台上,则删除它的虚拟机。
120111

112+
{{< note >}}
113+
<!--
114+
If any new Pods tolerate the `node.kubernetes.io/unschedulable` taint, then those Pods
115+
might be scheduled to the node you have drained. Avoid tolerating that taint other than
116+
for DaemonSets.
117+
-->
118+
如果存在新的、能够容忍 `node.kubernetes.io/unschedulable` 污点的 Pod,
119+
那么这些 Pod 可能会被调度到你已经清空的节点上。
120+
除了 DaemonSet 之外,请避免容忍此污点。
121+
122+
<!--
123+
If you or another API user directly set the [`nodeName`](/docs/concepts/scheduling-eviction/assign-pod-node/#nodename)
124+
field for a Pod (bypassing the scheduler), then the Pod is bound to the specified node
125+
and will run there, even though you have drained that node and marked it unschedulable.
126+
-->
127+
如果你或另一个 API 用户(绕过调度器)直接为 Pod 设置了
128+
[`nodeName`](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/#nodename)字段,
129+
则即使你已将该节点清空并标记为不可调度,Pod 仍将被绑定到这个指定的节点并在该节点上运行。
130+
{{< /note >}}
131+
132+
<!--
133+
First, identify the name of the node you wish to drain. You can list all of the nodes in your cluster with
134+
-->
121135
首先,确定想要清空的节点的名称。可以用以下命令列出集群中的所有节点:
122136

123137
```shell
@@ -174,9 +188,9 @@ respect the `PodDisruptionBudget` you specify.
174188
-->
175189
## 并行清空多个节点 {#draining-multiple-nodes-in-parallel}
176190

177-
`kubectl drain` 命令一次只能发送给一个节点。
178-
但是,你可以在不同的终端或后台为不同的节点并行地运行多个 `kubectl drain` 命令。
179-
同时运行的多个 drain 命令仍然遵循你指定的 `PodDisruptionBudget`
191+
`kubectl drain` 命令一次只能发送给一个节点。
192+
但是,你可以在不同的终端或后台为不同的节点并行地运行多个 `kubectl drain` 命令。
193+
同时运行的多个 drain 命令仍然遵循你指定的 `PodDisruptionBudget`
180194

181195
<!--
182196
For example, if you have a StatefulSet with three replicas and have

0 commit comments

Comments
 (0)