Skip to content

Commit c374291

Browse files
committed
Update docs on why env-vars are preferred
Mention that faas-cli can manage faasd secrets Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent febf792 commit c374291

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/reference/secrets.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ Using secrets is a two step process. First you need to define a new secret in yo
1313

1414
### A note on environmental variables
1515

16-
The OpenFaaS contributors believe that enviromental variables should be reserved for non-confidential data only. All secrets are made available in the container file-system and should be read from the following location: `/var/openfaas/secrets/<secret-name>`. Both Kubernetes and Swarm have excellent stores for secrets. In the sample below we show how to create and consume a secret in a function.
16+
All secrets are made available in the container file-system and should be read from the following location: `/var/openfaas/secrets/<secret-name>`. In the sample below we show how to create and consume a secret in a function.
17+
18+
> Note: The OpenFaaS philosophy is that environment variables should be used for non-confidential configuration values only, and not used to inject secrets.
19+
20+
The faas-cli can be used to manage secrets on Kubernetes, faasd, and Swarm.
1721

1822
> See also: [YAML reference: environmental variables](yaml.md).
1923
@@ -81,6 +85,10 @@ or:
8185
echo "R^YqzKzSJw51K9zPpQ3R3N" | docker secret create secret-api-key -
8286
```
8387

88+
#### Define a secret in faasd (advanced)
89+
90+
For faasd, the secrets created for functions are held as files at `/var/lib/faasd-provider/secrets`. When you deploy a function, these secrets are bind-mounted into your container.
91+
8492
### Use the secret in your function
8593

8694
OpenFaaS secrets are mounted as files to `/var/openfaas/secrets` inside your function's filesystem. To use a secret, just read the file from the secrets location using the name of the secret for the filename such as: `/var/openfaas/secrets/secret-api-key`.

0 commit comments

Comments
 (0)