@@ -19,6 +19,8 @@ This page shows how to enable and configure encryption of secret data at rest.
19
19
20
20
* To encrypt a custom resource, your cluster must be running Kubernetes v1.26 or newer.
21
21
22
+ * Use of wildcard for resource encryption is available from Kubernetes v1.27 or newer.
23
+
22
24
23
25
<!-- steps -->
24
26
@@ -63,6 +65,24 @@ resources:
63
65
keys :
64
66
- name : key1
65
67
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==
66
86
` ` `
67
87
68
88
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
84
104
data. If no provider can read the stored data due to a mismatch in format or secret key, an error
85
105
is returned which prevents clients from accessing that resource.
86
106
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
+
87
130
For more detailed information about the `EncryptionConfiguration` struct, please refer to the
88
131
[encryption configuration API](/docs/reference/config-api/apiserver-encryption.v1/).
89
132
0 commit comments