From 524e6c275acd400be5166a4dd739f10466a6ce53 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 30 Apr 2020 11:42:56 -0700 Subject: [PATCH] Added optional key name for --from-file. --- content/en/docs/concepts/configuration/secret.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/en/docs/concepts/configuration/secret.md b/content/en/docs/concepts/configuration/secret.md index d63a2cf3ac..0fa5b13efa 100644 --- a/content/en/docs/concepts/configuration/secret.md +++ b/content/en/docs/concepts/configuration/secret.md @@ -81,6 +81,12 @@ The output is similar to: secret "db-user-pass" created ``` +Default key name is the filename. You may optionally set the key name using `[--from-file=[key=]source]`. + +```shell +kubectl create secret generic db-user-pass --from-file=username=./username.txt --from-file=password=./password.txt +``` + {{< note >}} Special characters such as `$`, `\`, `*`, `=`, and `!` will be interpreted by your [shell](https://en.wikipedia.org/wiki/Shell_(computing)) and require escaping. In most shells, the easiest way to escape the password is to surround it with single quotes (`'`).