Simple Vault management setup using Consul as the backend storage of key-vaule pair configuration.
- virtualbox
- kubernetes
- helm (need Version 2)
- minikube
-
Start minkube
minikube start --vm-driver=virtualbox
-
From the repository directory, run
kubectl apply -f k8s/
. -
Follow instructions: https://learn.hashicorp.com/vault/getting-started-k8s/minikube. Note that all instance of
webapp
have been changed toapp
. -
When creating a Kubernetes authentication role, named
app
, that connects the Kubernetes service account name andapp
policy, run the following to match theserviceAccountName: k8s-simple
that was set in thedeployment.yml
file.vault write auth/kubernetes/role/app \ bound_service_account_names=k8s-simple \ bound_service_account_namespaces=default \ policies=app \ ttl=24h
-
Access consul ui:
minikube service hashicorp-consul-ui
. -
Verify if you can get the config by accessing
192.168.99.100:31515/:key
. The sample application assumes that theconfig
is in the vault pathsecret/data/app/config
where the values are injson
.
- https://www.vaultproject.io/docs/platform/k8s/helm/run/
- https://learn.hashicorp.com/vault/developer/sm-static-secrets
- https://learn.hashicorp.com/vault/identity-access-management/iam-policies
- https://www.vaultproject.io/docs/secrets/consul/ (Option if we are going to access KV's directly from Consul)