Skip to content
Permalink
Browse files

Fix code blocks secret.md (#13016)

The formatting is currently broken because code blocks are not correctly terminated.
  • Loading branch information...
juzna authored and k8s-ci-robot committed Apr 10, 2019
1 parent 2e3a250 commit ca8364403255c55cf8688113a6a87e89af0245a2
Showing with 23 additions and 0 deletions.
  1. +23 −0 content/en/docs/concepts/configuration/secret.md
@@ -521,12 +521,15 @@ ls /etc/foo/
username
password
```
```shell
cat /etc/foo/username
```
```
admin
```
```shell
cat /etc/foo/password
```
@@ -694,9 +697,11 @@ start until all the pod's volumes are mounted.
### Use-Case: Pod with ssh keys
Create a kustomization.yaml with SecretGenerator containing some ssh keys:
```shell
kubectl create secret generic ssh-key-secret --from-file=ssh-privatekey=/path/to/.ssh/id_rsa --from-file=ssh-publickey=/path/to/.ssh/id_rsa.pub
```
```
secret "ssh-key-secret" created
```
@@ -746,13 +751,31 @@ credentials and another pod which consumes a secret with test environment
credentials.
Make the kustomization.yaml with SecretGenerator
```shell
kubectl create secret generic prod-db-secret --from-literal=username=produser --from-literal=password=Y4nys7f11
```
```
secret "prod-db-secret" created
```
```shell
kubectl create secret generic test-db-secret --from-literal=username=testuser --from-literal=password=iluvtests
```
```
secret "test-db-secret" created
```
{{< note >}}
Special characters such as `$`, `\*`, and `!` require escaping.
If the password you are using has special characters, you need to escape them using the `\\` character. For example, if your actual password is `S!B\*d$zDsb`, you should execute the command this way:
```shell
kubectl create secret generic dev-db-secret --from-literal=username=devuser --from-literal=password=S\\!B\\\*d\\$zDsb
```
You do not need to escape special characters in passwords from files (`--from-file`).
{{< /note >}}
Now make the pods:
```shell

0 comments on commit ca83644

Please sign in to comment.
You can’t perform that action at this time.