Skip to content

Commit 1054d0b

Browse files
committed
docs: updates EncryptionConfiguration doc to add wildcard support to encrypt all resources.
Signed-off-by: Nilekh Chaudhari <[email protected]>
1 parent 9a804d2 commit 1054d0b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ This page shows how to enable and configure encryption of secret data at rest.
1919

2020
* To encrypt a custom resource, your cluster must be running Kubernetes v1.26 or newer.
2121

22+
* Use of wildcard for resource encryption is available from Kubernetes v1.27 or newer.
23+
2224

2325
<!-- steps -->
2426

@@ -63,6 +65,24 @@ resources:
6365
keys:
6466
- name: key1
6567
secret: YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY=
68+
- resources:
69+
- events
70+
providers:
71+
- identity: {} # do not encrypt events even though *.* is specified below
72+
- resources:
73+
- '*.apps'
74+
providers:
75+
- aescbc:
76+
keys:
77+
- name: key2
78+
secret: c2VjcmV0IGlzIHNlY3VyZSwgb3IgaXMgaXQ/Cg==
79+
- resources:
80+
- '*.*'
81+
providers:
82+
- aescbc:
83+
keys:
84+
- name: key3
85+
secret: c2VjcmV0IGlzIHNlY3VyZSwgSSB0aGluaw==
6686
```
6787
6888
Each `resources` array item is a separate config and contains a complete configuration. The
@@ -84,6 +104,29 @@ resources from storage, each provider that matches the stored data attempts in o
84104
data. If no provider can read the stored data due to a mismatch in format or secret key, an error
85105
is returned which prevents clients from accessing that resource.
86106

107+
`EncryptionConfiguration` supports the use of wildcards to specify the resources that should be encrypted.
108+
Use '`*.<group>`' to encrypt all resources within a group (for eg '`*.apps`' in above example) or '`*.*`'
109+
to encrypt all resources. '`*.`' can be used to encrypt all resource in the core group. '`*.*`' will
110+
encrypt all resources, even custom resources that are added after API server start.
111+
112+
{{< note >}} Use of wildcards that overlap within the same resource list or across multiple entries are not allowed
113+
since part of the configuration would be ineffective. The `resources` list's processing order and precedence
114+
are determined by the order it's listed in the configuration. {{< /note >}}
115+
116+
Opting out of encryption for specific resources while wildcard is enabled can be achieved by adding a new
117+
`resources` array item with the resource name, followed by the `providers` array item with the `identity` provider.
118+
For example, if '`*.*`' is enabled and you want to opt-out encryption for the `events` resource, add a new item
119+
to the `resources` array with `events` as the resource name, followed by the providers array item with `identity`.
120+
The new item should look like this:
121+
122+
```yaml
123+
- resources:
124+
- events
125+
providers:
126+
- identity: {}
127+
```
128+
Ensure that the new item is listed before the wildcard '`*.*`' item in the resources array to give it precedence.
129+
87130
For more detailed information about the `EncryptionConfiguration` struct, please refer to the
88131
[encryption configuration API](/docs/reference/config-api/apiserver-encryption.v1/).
89132

0 commit comments

Comments
 (0)