Skip to content

Commit 15e374d

Browse files
committed
Edit mounted secrets wording
- Change heading levels - Improve the intro sentence for the list - Style edit for the list items - Convert the limitations of explicit listing into a bullet list - In the bullet list, clean up phrasing - Remove the 'Read the secret data' bit. The existing steps on this page have the same instructions.
1 parent b592215 commit 15e374d

File tree

1 file changed

+14
-52
lines changed

1 file changed

+14
-52
lines changed

content/en/docs/tasks/inject-data-application/distribute-credentials-secure.md

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ Modify your image or command line so that the program looks for files in the
153153
`mountPath` directory. Each key in the Secret `data` map becomes a file name
154154
in this directory.
155155

156-
#### Projection of Secret keys to specific paths
156+
### Project Secret keys to specific file paths
157157

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:
160160

161161
```yaml
162162
apiVersion: v1
@@ -180,19 +180,22 @@ spec:
180180
path: my-group/my-username
181181
```
182182
183-
What will happen:
183+
When you deploy this Pod, the following happens:
184184
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
186186
`/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.
188188

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:
191191

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.
194197

195-
#### Secret files permissions
198+
### Set POSIX permissions for Secret keys
196199

197200
You can set the POSIX file access permission bits for a single Secret key.
198201
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.
229232
If you're writing YAML, you can write the `defaultMode` in octal.
230233
{{< /note >}}
231234

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-
273235
## Define container environment variables using Secret data
274236

275237
### Define a container environment variable with data from a single Secret

0 commit comments

Comments
 (0)