Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

Iterating on secret implementation: #50

Merged

Conversation

acornies
Copy link
Collaborator

@acornies acornies commented Sep 25, 2018

Hi @nicholasjackson, I wanted to iterate on the work you started for secrets, so here it is:

  • updated vault key prefix to follow this convention: secret/openfaas/{function}
  • updated deploy test to reflect changes
  • Added mapped volumes to the secrets location to follow openfaas format
  • secrets in a function.yml are now defined the same way as k8s, Swarm

Example Vault secret curl:

curl -i -H "X-Vault-Token: token" -H "Content-Type: application/json" -X POST -d '{"cows_test":"TESTACCESS", "another_secret": "SECRET"}' https://{vault_host}:8200/v1/secret/openfaas/cows

Example faas-cli:

faas-cli store deploy cows --secret "cows_test" --secret "another_secret"  --gateway http://{gateway}:8080

The secrets are then present in the container:

sudo docker exec -it cows-{uuid} ls /var/openfaas/secrets
another_secret  cows_test

This makes it so that secrets are defined the same way in .yml or faas-cli regardless if openfaas is running on K8s, Swarm or Nomad. However, it is expected that the secrets be stored in this format in Vault: secret/openfaas/{function}.

- updated vaultkey prefix to follow this convention: secret/openfaas/{function}
- updated deploy test to reflect changes
- Added mapped volumes to the secrets location to follow openfaas format
- secrets in a function.yml are now defined the same way as k8s, Swarm

Signed-off-by: Andrew Cornies <acornies@gmail.com>
This was referenced Sep 25, 2018
@nicholasjackson nicholasjackson merged commit 29e10f8 into hashicorp:feature/secrets Oct 1, 2018
@acornies acornies deleted the feature/secrets branch February 6, 2019 03:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants