Skip to content

Commit

Permalink
docs: remove make target and link to using direnv 78
Browse files Browse the repository at this point in the history
  • Loading branch information
nvernooy committed Sep 6, 2023
1 parent 331afaf commit 6ceec55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions {{cookiecutter.project_slug}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ secure: ## Analyze dependencies for security issues
node: ## Shell into the running Node container
@docker-compose exec frontend /bin/bash

read-op-secrets: ## Read the secrets from 1Password and set to enviroment variables
/bin/bash -c "source .envrc" && echo "Environment variables set from 1Password"

sandbox-secrets: ## Substitute with secrets template with env variable and run kubeseal
@echo "Sealing secrets from sandbox template to $$(kubectl config current-context)"
envsubst < k8s/templates/sandbox.secrets.yaml.template | kubeseal --format yaml > k8s/sandbox/secrets.yaml
Expand Down
7 changes: 3 additions & 4 deletions {{cookiecutter.project_slug}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ Configure kubernetes to your current project config and context, making sure you
$ export KUBECONFIG=~/.kube/config:~/.kube/{{cookiecutter.project_slug}}.ec2.config
$ kubectl config use-context {{cookiecutter.project_slug}}-ec2-cluster

To ease managing your passwords and secrets you can store the values in 1Password. The makefile target `read-op-secrets` will read the values from 1Password and export it to enviroment variables.
(The 1Password path in .envrc MUST match the path in the vault)

$ make read-op-secrets
To ease managing your passwords and secrets you can store the values in 1Password. The `.envrc` file will read from 1Password and export the values to the enviroment.
You will need to install and configure [1Password cli](https://developer.1password.com/docs/cli/get-started/)
You can automatically source from the `.envrc` file using [direnv](https://direnv.net/docs/installation.html)

You can also manually export the variables to your environment.
Add the secrets to your manifest using the secrets template file, and run kubeseal on the unencrypted values. The makefile target `sandbox-secrets` will replace the variables in `./k8s/templates/secrets.yaml.template` with the encoded variables from the environment, and copy the manifest with the encrypted values to `.k8s/sandbox/secrets.yaml`. The same can be done for the prod environment using the `prod-secrets` target
Expand Down

0 comments on commit 6ceec55

Please # to comment.