Skip to content

Commit 3df479c

Browse files
authored
Merge pull request #41574 from sftim/20230610_revise_encryption_at_rest_part
Update example YAML in encryption-at-rest topic
2 parents baae9ab + 163fd27 commit 3df479c

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

content/en/docs/tasks/administer-cluster/encrypt-data.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,24 @@ decrypt data stored in the etcd.
4545
## Understanding the encryption at rest configuration
4646

4747
```yaml
48+
---
49+
#
50+
# CAUTION: this is an example configuration.
51+
# Do not use this for your own cluster!
52+
#
4853
apiVersion: apiserver.config.k8s.io/v1
4954
kind: EncryptionConfiguration
5055
resources:
5156
- resources:
5257
- secrets
5358
- configmaps
54-
- pandas.awesome.bears.example
59+
- pandas.awesome.bears.example # a custom resource API
5560
providers:
56-
- identity: {}
61+
# This configuration does not provide data confidentiality. The first
62+
# configured provider is specifying the "identity" mechanism, which
63+
# stores resources as plain text.
64+
#
65+
- identity: {} # plain text, in other words NO encryption
5766
- aesgcm:
5867
keys:
5968
- name: key1
@@ -73,16 +82,16 @@ resources:
7382
- resources:
7483
- events
7584
providers:
76-
- identity: {} # do not encrypt events even though *.* is specified below
85+
- identity: {} # do not encrypt Events even though *.* is specified below
7786
- resources:
78-
- '*.apps'
87+
- '*.apps' # wildcard match requires Kubernetes 1.27 or later
7988
providers:
8089
- aescbc:
8190
keys:
8291
- name: key2
8392
secret: c2VjcmV0IGlzIHNlY3VyZSwgb3IgaXMgaXQ/Cg==
8493
- resources:
85-
- '*.*'
94+
- '*.*' # wildcard match requires Kubernetes 1.27 or later
8695
providers:
8796
- aescbc:
8897
keys:
@@ -272,6 +281,7 @@ retrieve the plaintext values, providing a higher level of security than locally
272281
Create a new encryption config file:
273282

274283
```yaml
284+
---
275285
apiVersion: apiserver.config.k8s.io/v1
276286
kind: EncryptionConfiguration
277287
resources:
@@ -283,8 +293,10 @@ resources:
283293
- aescbc:
284294
keys:
285295
- name: key1
296+
# See the following text for more details about the secret value
286297
secret: <BASE 64 ENCODED SECRET>
287-
- identity: {}
298+
- identity: {} # this fallback allows reading unencrypted secrets;
299+
# for example, during initial migratoin
288300
```
289301

290302
To create a new Secret, perform the following steps:
@@ -305,14 +317,19 @@ To create a new Secret, perform the following steps:
305317
1. Edit the manifest for the `kube-apiserver` static pod: `/etc/kubernetes/manifests/kube-apiserver.yaml` similarly to this:
306318

307319
```yaml
320+
---
321+
#
322+
# This is a fragment of a manifest for a static Pod.
323+
# Check whether this is correct for your cluster and for your API server.
324+
#
308325
apiVersion: v1
309326
kind: Pod
310327
metadata:
311328
annotations:
312-
kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint: 10.10.30.4:6443
329+
kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint: 10.20.30.40:443
313330
creationTimestamp: null
314331
labels:
315-
component: kube-apiserver
332+
app.kubernetes.io/component: kube-apiserver
316333
tier: control-plane
317334
name: kube-apiserver
318335
namespace: kube-system
@@ -443,6 +460,7 @@ To disable encryption at rest, place the `identity` provider as the first entry
443460
and restart all `kube-apiserver` processes.
444461

445462
```yaml
463+
---
446464
apiVersion: apiserver.config.k8s.io/v1
447465
kind: EncryptionConfiguration
448466
resources:

0 commit comments

Comments
 (0)