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/en/docs/tasks/administer-cluster/kms-provider.md
+58-26Lines changed: 58 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,43 +19,58 @@ This page shows how to configure a Key Management Service (KMS) provider and plu
19
19
20
20
<!-- steps -->
21
21
22
-
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
23
-
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.
22
+
The KMS encryption provider uses an envelope encryption scheme to encrypt data in etcd.
23
+
The data is encrypted using a data encryption key (DEK); a new DEK is generated for each encryption.
24
+
The DEKs are encrypted with a key encryption key (KEK) that is stored and managed in a remote KMS.
25
+
The KMS provider uses gRPC to communicate with a specific KMS plugin.
26
+
The KMS plugin, which is implemented as a gRPC server and deployed on the same host(s)
27
+
as the Kubernetes control plane, is responsible for all communication with the remote KMS.
24
28
25
29
## Configuring the KMS provider
26
30
27
-
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:
31
+
To configure a KMS provider on the API server, include a provider of type `kms` in the
32
+
`providers` array in the encryption configuration file and set the following properties:
28
33
29
34
*`name`: Display name of the KMS plugin.
30
35
*`endpoint`: Listen address of the gRPC server (KMS plugin). The endpoint is a UNIX domain socket.
31
36
*`cachesize`: Number of data encryption keys (DEKs) to be cached in the clear.
32
37
When cached, DEKs can be used without another call to the KMS;
33
38
whereas DEKs that are not cached require a call to the KMS to unwrap.
34
-
*`timeout`: How long should kube-apiserver wait for kms-plugin to respond before returning an error (default is 3 seconds).
39
+
*`timeout`: How long should `kube-apiserver` wait for kms-plugin to respond before
40
+
returning an error (default is 3 seconds).
35
41
36
-
See [Understanding the encryption at rest configuration.](/docs/tasks/administer-cluster/encrypt-data)
42
+
See [Understanding the encryption at rest configuration](/docs/tasks/administer-cluster/encrypt-data).
37
43
38
44
## Implementing a KMS plugin
39
45
40
-
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.
46
+
To implement a KMS plugin, you can develop a new plugin gRPC server or enable a KMS plugin
47
+
already provided by your cloud provider.
48
+
You then integrate the plugin with the remote KMS and deploy it on the Kubernetes master.
41
49
42
50
### Enabling the KMS supported by your cloud provider
51
+
43
52
Refer to your cloud provider for instructions on enabling the cloud provider-specific KMS plugin.
44
53
45
54
### Developing a KMS plugin gRPC server
46
-
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.
47
55
48
-
* Using Go: Use the functions and data structures in the stub file: [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
56
+
You can develop a KMS plugin gRPC server using a stub file available for Go. For other languages,
57
+
you use a proto file to create a stub file that you can use to develop the gRPC server code.
58
+
59
+
* Using Go: Use the functions and data structures in the stub file:
* 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
63
+
* 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.
53
68
54
69
**Notes:**
55
70
56
71
* kms plugin version: `v1beta1`
57
72
58
-
In response to procedure call Version, a compatible KMS plugin should return v1beta1 as VersionResponse.version.
73
+
In response to procedure call Version, a compatible KMS plugin should return `v1beta1` as `VersionResponse.version`.
59
74
60
75
* message version: `v1beta1`
61
76
@@ -69,12 +84,15 @@ Then use the functions and data structures in the stub file to develop the serve
69
84
70
85
The KMS plugin can communicate with the remote KMS using any protocol supported by the KMS.
71
86
All configuration data, including authentication credentials the KMS plugin uses to communicate with the remote KMS,
72
-
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.
87
+
are stored and managed by the KMS plugin independently.
88
+
The KMS plugin can encode the ciphertext with additional metadata that may be required before sending it to the KMS for decryption.
73
89
74
90
### Deploying the KMS plugin
91
+
75
92
Ensure that the KMS plugin runs on the same host(s) as the Kubernetes master(s).
76
93
77
94
## Encrypting your data with the KMS provider
95
+
78
96
To encrypt the data:
79
97
80
98
1. Create a new encryption configuration file using the appropriate properties for the `kms` provider:
@@ -94,32 +112,43 @@ To encrypt the data:
94
112
- identity: {}
95
113
```
96
114
97
-
1. Set the `--encryption-provider-config` flag on the kube-apiserver to point to the location of the configuration file.
115
+
1. Set the `--encryption-provider-config` flag on the kube-apiserver to point to
116
+
the location of the configuration file.
98
117
1. Restart your API server.
99
118
119
+
For details about the `EncryptionConfiguration` format, please check the
120
+
[API server encryption API reference](/docs/reference/config-api/apiserver-encryption.v1/).
121
+
100
122
## Verifying that the data is encrypted
101
123
102
124
Data is encrypted when written to etcd. After restarting your `kube-apiserver`,
103
125
any newly created or updated secret should be encrypted when stored. To verify,
104
126
you can use the `etcdctl` command line program to retrieve the contents of your secret.
105
127
106
-
1. Create a new secret called secret1 in the default namespace:
107
-
```
128
+
1. Create a new secret called `secret1` in the `default` namespace:
0 commit comments