Skip to content

Commit 134eeb2

Browse files
committed
Add step numbering to steps
1 parent 28a872e commit 134eeb2

File tree

1 file changed

+38
-31
lines changed

1 file changed

+38
-31
lines changed

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

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,51 @@ 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:
29+
1. Convert the strings to base64:
3030

31-
```shell
32-
echo -n 'admin' | base64
33-
echo -n '1f2d1e2e67df' | base64
34-
```
31+
```shell
32+
echo -n 'admin' | base64
33+
echo -n '1f2d1e2e67df' | base64
34+
```
3535

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 >}}
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 using the `base64` utility on Darwin/macOS, users should avoid using the `-b` option to split long lines. Conversely, Linux users *should* add the option `-w 0` to `base64` commands or the pipeline `base64 | tr -d '\n'` if the `-w` option is not available. {{< /note >}}
4439

45-
The output is similar to:
40+
The output is similar to:
4641

47-
```
48-
YWRtaW4=
49-
MWYyZDFlMmU2N2Rm
50-
```
42+
```
43+
YWRtaW4=
44+
MWYyZDFlMmU2N2Rm
45+
```
5146

52-
Create the configuration file:
47+
1. Create the configuration file:
5348

54-
```yaml
55-
apiVersion: v1
56-
kind: Secret
57-
metadata:
58-
name: mysecret
59-
type: Opaque
60-
data:
61-
username: YWRtaW4=
62-
password: MWYyZDFlMmU2N2Rm
63-
```
49+
```yaml
50+
apiVersion: v1
51+
kind: Secret
52+
metadata:
53+
name: mysecret
54+
type: Opaque
55+
data:
56+
username: YWRtaW4=
57+
password: MWYyZDFlMmU2N2Rm
58+
```
59+
60+
Note that the name of a Secret object must be a valid
61+
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
62+
63+
1. Create the Secret using [`kubectl apply`](/docs/reference/generated/kubectl/kubectl-commands#apply):
64+
65+
```shell
66+
kubectl apply -f ./secret.yaml
67+
```
68+
69+
The output is similar to:
6470

65-
Note that the name of a Secret object must be a valid
66-
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
71+
```
72+
secret/mysecret created
73+
```
6774
6875
For certain scenarios, you may wish to use the `stringData` field instead. This
6976
field allows you to put a non-base64 encoded string directly into the Secret,

0 commit comments

Comments
 (0)