Skip to content

Hashicorp Vault

Example shows how to use hashicorp vault as a data source.

Project structure

├── README.md
├── helmwave.yml
└── values-secret.yaml

Step 1. Create next secret

vault kv put secret/test hello=world 

Step 2. Create helmwave.yml

project: "Example: vault"
version: "0.41.1"

repositories:
  - name: bitnami
    url: https://charts.bitnami.com/bitnami

releases:
  - name: app
    chart: bitnami/nginx
    namespace: test
    wait: true
    values:
      - values-secret.yaml

Step 3. Create values-secret.yaml

{{ defineDatasource "vault" "vault:///secret/data/test" }} # `data` is required for vault kv2

secret: {{ (ds "vault").data.hello }}
revesion_of_secret: {{ (ds "vault").metadata.version }}

Step 4. Run helmwave build --templater gomplate

You will get

secret: world
revision_of_secret: 2

Debug with gomplate

  1. install gomplate binary
  2. run it in your console
gomplate -d "vault=vault+https:///secret/data/test" -i '{{(ds "vault").metadata.version}}'
gomplate -d "vault=vault+https:///secret/data/test" -i '{{(ds "vault").data.hello}}'

see gomplate docs here