Skip to content

Commit ecb377a

Browse files
committed
docs: improved README
Signed-off-by: András Jáky <ajaky@cisco.com>
1 parent 3535593 commit ecb377a

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ up: ## Start kind development environment
8787
--set podsFailurePolicy=Fail \
8888
--set vaultEnv.tag=latest \
8989
--namespace bank-vaults-infra
90-
kind load docker-image ghcr.io/bank-vaults/vault-secrets-reloader:dev --name $(TEST_KIND_CLUSTER)
9190

9291
.PHONY: down
9392
down: ## Destroy kind development environment
@@ -125,6 +124,7 @@ generate: gen-helm-docs ## Generate manifests, code, and docs resources
125124

126125
.PHONY: deploy
127126
deploy: ## Deploy manager resources to the K8s cluster
127+
kind load docker-image $(IMG) --name $(TEST_KIND_CLUSTER)
128128
kubectl create namespace bank-vaults-infra --dry-run=client -o yaml | kubectl apply -f -
129129
$(HELM) upgrade --install vault-secrets-reloader deploy/charts/vault-secrets-reloader \
130130
--set image.tag=dev \

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,27 @@ helm upgrade --install vault-secrets-reloader deploy/charts/vault-secrets-reload
8787
--namespace bank-vaults-infra
8888
```
8989

90+
Reloader needs to access the Vault instance on its own, so make sure you set the correct environment variables through
91+
the chart, also use a time interval (in Go Duration format) that works best for your use case for collecting data from
92+
the workloads and for the actual reloading, for example:
93+
94+
```shell
95+
helm upgrade --install vault-secrets-reloader oci://ghcr.io/bank-vaults/vault-secrets-reloader \
96+
--set collectorSyncPeriod=2h \
97+
--set reloaderRunPeriod=4h \
98+
--set env.VAULT_ADDR=[URL for Vault]
99+
--set env.VAULT_PATH=[Auth path]
100+
--set env.VAULT_ROLE=[Auth role]
101+
--set env.VAULT_AUTH_METHOD=[Auth method]
102+
# other environmental variables needed for the auth method of your choice
103+
--namespace bank-vaults-infra --create-namespace
104+
```
105+
106+
Vault also needs to be configured with an auth method for the Reloader to use, additionally it is advised to create a
107+
role and policy that allows the Reloader to `read` and `list` secrets from Vault. An example for that can be found in
108+
this repository in the [example Bank-Vaults Operator CR
109+
file](https://github.com/bank-vaults/vault-secrets-reloader/blob/main/e2e/deploy/vault/vault.yaml#L102).
110+
90111
Now that we have the Bank-Vaults ecosystem running in our kind cluster, we can try out the Reloader in action:
91112

92113
```shell

e2e/deploy/vault/vault.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ spec:
105105
rules: path "secret/*" {
106106
capabilities = ["create", "read", "update", "delete", "list"]
107107
}
108+
# define a new policy for the Reloader
108109
- name: read_secrets
109110
rules: path "secret/*" {
110111
capabilities = ["read", "list"]
@@ -135,7 +136,7 @@ spec:
135136
- name: reloader
136137
bound_service_account_names: ["vault-secrets-reloader"]
137138
bound_service_account_namespaces: ["bank-vaults-infra"]
138-
policies: ["read_secrets"]
139+
policies: ["read_secrets"] # use the read_secrets policy in the reloader role
139140
ttl: 1h
140141

141142
secrets:

0 commit comments

Comments
 (0)