mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Improve console output in secrets doc.
This commit is contained in:
parent
0647292558
commit
e7042a403b
@ -47,13 +47,13 @@ A secret contains a set of named byte arrays.
|
|||||||
|
|
||||||
Use the [`examples/secrets/secret.yaml`](secret.yaml) file to create a secret:
|
Use the [`examples/secrets/secret.yaml`](secret.yaml) file to create a secret:
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
$ kubectl create -f docs/user-guide/secrets/secret.yaml
|
$ kubectl create -f docs/user-guide/secrets/secret.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use `kubectl` to see information about the secret:
|
You can use `kubectl` to see information about the secret:
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
$ kubectl get secrets
|
$ kubectl get secrets
|
||||||
NAME TYPE DATA
|
NAME TYPE DATA
|
||||||
test-secret Opaque 2
|
test-secret Opaque 2
|
||||||
@ -78,14 +78,14 @@ consumes it.
|
|||||||
|
|
||||||
Use the [`examples/secrets/secret-pod.yaml`](secret-pod.yaml) file to create a Pod that consumes the secret.
|
Use the [`examples/secrets/secret-pod.yaml`](secret-pod.yaml) file to create a Pod that consumes the secret.
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
$ kubectl create -f docs/user-guide/secrets/secret-pod.yaml
|
$ kubectl create -f docs/user-guide/secrets/secret-pod.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
This pod runs a binary that displays the content of one of the pieces of secret data in the secret
|
This pod runs a binary that displays the content of one of the pieces of secret data in the secret
|
||||||
volume:
|
volume:
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
$ kubectl logs secret-test-pod
|
$ kubectl logs secret-test-pod
|
||||||
2015-04-29T21:17:24.712206409Z content of file "/etc/secret-volume/data-1": value-1
|
2015-04-29T21:17:24.712206409Z content of file "/etc/secret-volume/data-1": value-1
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user