Skip to content

Commit 28a872e

Browse files
committed
Update step intros and improve step formatting
1 parent 12e85f6 commit 28a872e

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,30 @@ The keys of `data` and `stringData` must consist of alphanumeric characters,
2626

2727
The following example stores two strings in a Secret using the `data` field.
2828

29-
Convert the strings to base64 as follows:
29+
Convert the strings to base64:
3030

3131
```shell
3232
echo -n 'admin' | base64
33-
```
34-
35-
The output is similar to:
36-
37-
```
38-
YWRtaW4=
39-
```
40-
41-
```shell
4233
echo -n '1f2d1e2e67df' | base64
4334
```
4435

36+
{{< note >}}
37+
The serialized JSON and YAML values of Secret data are encoded as base64
38+
strings. Newlines are not valid within these strings and must be omitted. When
39+
using the `base64` utility on Darwin/macOS, users should avoid using the `-b`
40+
option to split long lines. Conversely, Linux users *should* add the option
41+
`-w 0` to `base64` commands or the pipeline `base64 | tr -d '\n'` if the `-w`
42+
option is not available.
43+
{{< /note >}}
44+
4545
The output is similar to:
4646

4747
```
48+
YWRtaW4=
4849
MWYyZDFlMmU2N2Rm
4950
```
5051

51-
Write a Secret config file that looks like this:
52+
Create the configuration file:
5253

5354
```yaml
5455
apiVersion: v1
@@ -64,15 +65,6 @@ data:
6465
Note that the name of a Secret object must be a valid
6566
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
6667
67-
{{< note >}}
68-
The serialized JSON and YAML values of Secret data are encoded as base64
69-
strings. Newlines are not valid within these strings and must be omitted. When
70-
using the `base64` utility on Darwin/macOS, users should avoid using the `-b`
71-
option to split long lines. Conversely, Linux users *should* add the option
72-
`-w 0` to `base64` commands or the pipeline `base64 | tr -d '\n'` if the `-w`
73-
option is not available.
74-
{{< /note >}}
75-
7668
For certain scenarios, you may wish to use the `stringData` field instead. This
7769
field allows you to put a non-base64 encoded string directly into the Secret,
7870
and the string will be encoded for you when the Secret is created or updated.
@@ -104,9 +96,7 @@ stringData:
10496
password: <password>
10597
```
10698

107-
## Create the Secret object
108-
109-
Now create the Secret using [`kubectl apply`](/docs/reference/generated/kubectl/kubectl-commands#apply):
99+
Create the Secret using [`kubectl apply`](/docs/reference/generated/kubectl/kubectl-commands#apply):
110100

111101
```shell
112102
kubectl apply -f ./secret.yaml

0 commit comments

Comments
 (0)