Skip to content

Commit 37ff0ae

Browse files
authored
Merge pull request #20690 from Joelbear5/patch-1
Documented setting optional key name in secret.md for --from-file.
2 parents 5fbcd30 + 524e6c2 commit 37ff0ae

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)