You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/tasks/configmap-secret/managing-secret-using-config-file.md
+38-31Lines changed: 38 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,44 +26,51 @@ The keys of `data` and `stringData` must consist of alphanumeric characters,
26
26
27
27
The following example stores two strings in a Secret using the `data` field.
28
28
29
-
Convert the strings to base64:
29
+
1.Convert the strings to base64:
30
30
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
+
```
35
35
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 >}}
44
39
45
-
The output is similar to:
40
+
The output is similar to:
46
41
47
-
```
48
-
YWRtaW4=
49
-
MWYyZDFlMmU2N2Rm
50
-
```
42
+
```
43
+
YWRtaW4=
44
+
MWYyZDFlMmU2N2Rm
45
+
```
51
46
52
-
Create the configuration file:
47
+
1.Create the configuration file:
53
48
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
0 commit comments