Skip to content

Commit 524e6c2

Browse files
authored
Added optional key name for --from-file.
1 parent 21f4066 commit 524e6c2

File tree

1 file changed

+6
-0
lines changed
  • content/en/docs/concepts/configuration

1 file changed

+6
-0
lines changed

content/en/docs/concepts/configuration/secret.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ The output is similar to:
8181
secret "db-user-pass" created
8282
```
8383

84+
Default key name is the filename. You may optionally set the key name using `[--from-file=[key=]source]`.
85+
86+
```shell
87+
kubectl create secret generic db-user-pass --from-file=username=./username.txt --from-file=password=./password.txt
88+
```
89+
8490
{{< note >}}
8591
Special characters such as `$`, `\`, `*`, `=`, and `!` will be interpreted by your [shell](https://en.wikipedia.org/wiki/Shell_(computing)) and require escaping.
8692
In most shells, the easiest way to escape the password is to surround it with single quotes (`'`).

0 commit comments

Comments
 (0)