@@ -153,10 +153,10 @@ Modify your image or command line so that the program looks for files in the
153
153
` mountPath ` directory. Each key in the Secret ` data ` map becomes a file name
154
154
in this directory.
155
155
156
- #### Projection of Secret keys to specific paths
156
+ ### Project Secret keys to specific file paths
157
157
158
- You can also control the paths within the volume where Secret keys are projected.
159
- You can use the ` .spec.volumes[].secret.items ` field to change the target path of each key:
158
+ You can also control the paths within the volume where Secret keys are projected. Use the ` .spec.volumes[].secret.items ` field to change the target
159
+ path of each key:
160
160
161
161
``` yaml
162
162
apiVersion : v1
@@ -180,19 +180,22 @@ spec:
180
180
path : my-group/my-username
181
181
` ` `
182
182
183
- What will happen :
183
+ When you deploy this Pod, the following happens :
184
184
185
- * the ` username` key from `mysecret` is available to the container at the path
185
+ * The ` username` key from `mysecret` is available to the container at the path
186
186
` /etc/foo/my-group/my-username` instead of at `/etc/foo/username`.
187
- * the `password` key from that Secret object is not projected.
187
+ * The `password` key from that Secret object is not projected.
188
188
189
- If `.spec.volumes[].secret.items` is used, only keys specified in `items` are projected.
190
- To consume all keys from the Secret, all of them must be listed in the `items` field.
189
+ If you list keys explicitly using `.spec.volumes[].secret.items`, consider the
190
+ following :
191
191
192
- If you list keys explicitly, then all listed keys must exist in the corresponding Secret.
193
- Otherwise, the volume is not created.
192
+ * Only keys specified in `items` are projected.
193
+ * To consume all keys from the Secret, all of them must be listed in the
194
+ ` items` field.
195
+ * All listed keys must exist in the corresponding Secret. Otherwise, the volume
196
+ is not created.
194
197
195
- # ### Secret files permissions
198
+ # ## Set POSIX permissions for Secret keys
196
199
197
200
You can set the POSIX file access permission bits for a single Secret key.
198
201
If you don't specify any permissions, `0644` is used by default.
@@ -229,47 +232,6 @@ for the `defaultMode` (for example, 0400 in octal is 256 in decimal) instead.
229
232
If you're writing YAML, you can write the `defaultMode` in octal.
230
233
{{< /note >}}
231
234
232
- # ### Consuming Secret values from volumes
233
-
234
- Inside the container that mounts a secret volume, the secret keys appear as
235
- files. The secret values are base64 decoded and stored inside these files.
236
-
237
- This is the result of commands executed inside the container from the example above :
238
-
239
- ` ` ` shell
240
- ls /etc/foo/
241
- ` ` `
242
-
243
- The output is similar to :
244
-
245
- ` ` `
246
- username
247
- password
248
- ` ` `
249
-
250
- ` ` ` shell
251
- cat /etc/foo/username
252
- ` ` `
253
-
254
- The output is similar to :
255
-
256
- ` ` `
257
- admin
258
- ` ` `
259
-
260
- ` ` ` shell
261
- cat /etc/foo/password
262
- ` ` `
263
-
264
- The output is similar to :
265
-
266
- ` ` `
267
- 1f2d1e2e67df
268
- ` ` `
269
-
270
- The program in a container is responsible for reading the secret data from these
271
- files, as needed.
272
-
273
235
# # Define container environment variables using Secret data
274
236
275
237
# ## Define a container environment variable with data from a single Secret
0 commit comments