Add a note regarding escaping characters (#8844)

* Add a note regarding escaping characters

Updated docs with a note regarding escaping characters, it's important because it won't work well otherwise.

* Update secret.md

* No escape required for --from-file

Feedback from @mengqiy
This commit is contained in:
Shanica 2018-06-12 02:58:27 +03:00 committed by k8s-ci-robot
parent d56e4ce4d2
commit c3783c3b6a
1 changed files with 8 additions and 0 deletions

View File

@ -532,6 +532,14 @@ secret "prod-db-secret" created
$ kubectl create secret generic test-db-secret --from-literal=username=testuser --from-literal=password=iluvtests
secret "test-db-secret" created
```
{{< note >}}
**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:
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: