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: content/zh-cn/docs/tasks/administer-cluster/kms-provider.md
+94-60Lines changed: 94 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,9 @@ title: Using a KMS provider for data encryption
9
9
content_type: task
10
10
-->
11
11
<!-- overview -->
12
-
<!-- This page shows how to configure a Key Management Service (KMS) provider and plugin to enable secret data encryption. -->
12
+
<!--
13
+
This page shows how to configure a Key Management Service (KMS) provider and plugin to enable secret data encryption.
14
+
-->
13
15
14
16
本页展示了如何配置秘钥管理服务—— Key Management Service (KMS) 驱动和插件以启用
15
17
Secret 数据加密。
@@ -18,8 +20,10 @@ Secret 数据加密。
18
20
19
21
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
20
22
21
-
<!-- * Kubernetes version 1.10.0 or later is required -->
22
-
<!-- * etcd v3 or later is required -->
23
+
<!--
24
+
* Kubernetes version 1.10.0 or later is required
25
+
* etcd v3 or later is required
26
+
-->
23
27
* 需要 Kubernetes 1.10.0 或更新版本
24
28
* 需要 etcd v3 或更新版本
25
29
@@ -28,47 +32,59 @@ Secret 数据加密。
28
32
<!-- steps -->
29
33
30
34
<!--
31
-
The KMS encryption provider uses an envelope encryption scheme to encrypt data in etcd. The data is encrypted using a data encryption key (DEK); a new DEK is generated for each encryption. The DEKs are encrypted with a key encryption key (KEK) that is stored and managed in a remote KMS. The KMS provider uses gRPC to communicate with a specific KMS
32
-
plugin. The KMS plugin, which is implemented as a gRPC server and deployed on the same host(s) as the Kubernetes master(s), is responsible for all communication with the remote KMS.
35
+
The KMS encryption provider uses an envelope encryption scheme to encrypt data in etcd.
36
+
The data is encrypted using a data encryption key (DEK); a new DEK is generated for each encryption.
37
+
The DEKs are encrypted with a key encryption key (KEK) that is stored and managed in a remote KMS.
38
+
The KMS provider uses gRPC to communicate with a specific KMS plugin.
39
+
The KMS plugin, which is implemented as a gRPC server and deployed on the same host(s)
40
+
as the Kubernetes control plane, is responsible for all communication with the remote KMS.
33
41
-->
34
42
KMS 加密驱动使用封套加密模型来加密 etcd 中的数据。
35
43
数据使用数据加密秘钥(DEK)加密;每次加密都生成一个新的 DEK。
36
44
这些 DEK 经一个秘钥加密秘钥(KEK)加密后在一个远端的 KMS 中存储和管理。
37
45
KMS 驱动使用 gRPC 与一个特定的 KMS 插件通信。这个 KMS 插件作为一个 gRPC
38
-
服务器被部署在 Kubernetes 主服务器的同一个主机上,负责与远端 KMS 的通信。
46
+
服务器被部署在 Kubernetes 控制平面的相同主机上,负责与远端 KMS 的通信。
39
47
40
48
<!--
41
49
## Configuring the KMS provider
42
50
43
-
To configure a KMS provider on the API server, include a provider of type ```kms``` in the providers array in the encryption configuration file and set the following properties:
51
+
To configure a KMS provider on the API server, include a provider of type `kms` in the
52
+
`providers` array in the encryption configuration file and set the following properties:
44
53
-->
45
-
## 配置 KMS 驱动
54
+
## 配置 KMS 驱动 {#configuring-the-kms-provider}
46
55
47
-
为了在 API 服务器上配置 KMS 驱动,在加密配置文件中的驱动数组中加入一个类型为`kms`
56
+
为了在 API 服务器上配置 KMS 驱动,在加密配置文件中的 `providers` 数组中加入一个类型为`kms`
48
57
的驱动,并设置下列属性:
49
58
50
59
<!--
51
60
* `name`: Display name of the KMS plugin.
52
61
* `endpoint`: Listen address of the gRPC server (KMS plugin). The endpoint is a UNIX domain socket.
53
-
* `cachesize`: Number of data encryption keys (DEKs) to be cached in the clear. When cached, DEKs can be used without another call to the KMS; whereas DEKs that are not cached require a call to the KMS to unwrap.
54
-
* `timeout`: How long should kube-apiserver wait for kms-plugin to respond before returning an error (default is 3 seconds).
62
+
* `cachesize`: Number of data encryption keys (DEKs) to be cached in the clear.
63
+
When cached, DEKs can be used without another call to the KMS;
64
+
whereas DEKs that are not cached require a call to the KMS to unwrap.
65
+
* `timeout`: How long should `kube-apiserver` wait for kms-plugin to respond before
To implement a KMS plugin, you can develop a new plugin gRPC server or enable a KMS plugin already provided by your cloud provider. You then integrate the plugin with the remote KMS and deploy it on the Kubernetes master.
83
+
To implement a KMS plugin, you can develop a new plugin gRPC server or enable a KMS plugin
84
+
already provided by your cloud provider.
85
+
You then integrate the plugin with the remote KMS and deploy it on the Kubernetes master.
You can develop a KMS plugin gRPC server using a stub file available for Go. For other languages, you use a proto file to create a stub file that you can use to develop the gRPC server code.
103
+
You can develop a KMS plugin gRPC server using a stub file available for Go. For other languages,
104
+
you use a proto file to create a stub file that you can use to develop the gRPC server code.
* Using Go: Use the functions and data structures in the stub file:
96
-
[service.pb.go](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.pb.go) to develop the gRPC server code
* Using languages other than Go: Use the protoc compiler with the proto file: [service.proto](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1/service.proto) to generate a stub file for the specific language
120
+
* Using languages other than Go: Use the protoc compiler with the proto file:
Then use the functions and data structures in the stub file to develop the server code.
110
130
-->
111
131
然后使用存根文件中的函数和数据结构开发服务器代码。
112
132
113
-
<!-- **Notes:** -->
133
+
<!--
134
+
**Notes:**
135
+
-->
114
136
**注意:**
115
137
116
138
<!--
117
139
* kms plugin version: `v1beta1`
118
-
119
-
In response to procedure call Version, a compatible KMS plugin should return v1beta1 as VersionResponse.version.
140
+
In response to procedure call Version, a compatible KMS plugin should return `v1beta1` as `VersionResponse.version`.
120
141
121
142
* message version: `v1beta1`
122
143
@@ -128,7 +149,7 @@ Then use the functions and data structures in the stub file to develop the serve
128
149
-->
129
150
* kms 插件版本:`v1beta1`
130
151
131
-
作为对过程调用 Version 的响应,兼容的 KMS 插件应把 v1beta1 作为 VersionResponse.version 返回
152
+
作为对过程调用 Version 的响应,兼容的 KMS 插件应把 `v1beta1` 作为 `VersionResponse.version` 版本返回。
132
153
133
154
* 消息版本:`v1beta1`
134
155
@@ -143,9 +164,10 @@ Then use the functions and data structures in the stub file to develop the serve
143
164
144
165
The KMS plugin can communicate with the remote KMS using any protocol supported by the KMS.
145
166
All configuration data, including authentication credentials the KMS plugin uses to communicate with the remote KMS,
146
-
are stored and managed by the KMS plugin independently. The KMS plugin can encode the ciphertext with additional metadata that may be required before sending it to the KMS for decryption.
167
+
are stored and managed by the KMS plugin independently.
168
+
The KMS plugin can encode the ciphertext with additional metadata that may be required before sending it to the KMS for decryption.
For details about the `EncryptionConfiguration` format, please check the
224
+
[API server encryption API reference](/docs/reference/config-api/apiserver-encryption.v1/).
225
+
-->
226
+
有关 `EncryptionConfiguration` 格式的更多详细信息,请参阅
227
+
[kube-apiserver 加密 API 参考 (v1)](/zh-cn/docs/reference/config-api/apiserver-encryption.v1/).
228
+
199
229
<!--
200
230
## Verifying that the data is encrypted
201
231
202
-
Data is encrypted when written to etcd. After restarting your kube-apiserver, any newly created or updated secret should be encrypted when stored. To verify, you can use the etcdctl command line program to retrieve the contents of your secret.
232
+
Data is encrypted when written to etcd. After restarting your `kube-apiserver`,
233
+
any newly created or updated secret should be encrypted when stored. To verify,
234
+
you can use the `etcdctl` command line program to retrieve the contents of your secret.
The following command reads all secrets and then updates them to apply server side encryption. If an error occurs due to a conflicting write, retry the command.
291
+
The following command reads all secrets and then updates them to apply server side encryption.
292
+
If an error occurs due to a conflicting write, retry the command.
259
293
For larger clusters, you may wish to subdivide the secrets by namespace or script an update.
0 commit comments