Vault

This document contains the steps needed to initialize an existing Vault instance and to obtain the role_id and app_id needed for Garden Enterprise.

At this point, you should already have a Vault instance running that you can connect to.

Setting up Vault JWT Authentication

The commands below should be run from a host that has access to Vault, not in the Vault instance itself.

After going through the these steps, you'll have the Vault App ID and Vault Secret ID that Garden Enterprise needs. These values are provided to Garden Enterprise via the admin console during the installation process.

Connect to Vault

How you connect to Vault depends on your set up. In what follows, we'll assume you're coming here from Initialize Bundled Vault step of our installation guide and that you will connect to Vault via a kubectl port-forward.

Assuming you have the kubectl context set to that of the Garden Enterprise cluster, run:

kubectl --namespace garden-enterprise port-forward svc/prod-charts-vault 8200:8200

Note: If you're installing Garden Enterprise into a namespace other than the default garden-enterprise, use that namespace name instead.

Set Environment

Export the following environment variables:

export VAULT_SKIP_VERIFY=TRUE
export VAULT_ADDR=http://localhost:8200

Note: If you're not connecting to Vault over a port-forward as described in Connect to Vault step above, you may need to set a different VAULT_ADDR.

To verify that everything works, try running:

You should see a response like:

Initialize Vault

Run:

You should get a response like:

Add Root Token to Environment

Export the root token from the step above by running:

Enable JWT Auth

Run:

Write JWT Public Key

Write the JWT private key you created for the Garden Enterprise installation (see the Prepare Environment Variables step of the installation guide).

Write Policy

Create a file called policy.hcl and add the following to it:

and then run:

Enable App Role

Run:

Update App Role

Run:

Here, we're using the environment variables set in the Set Environment step above, and the app role we enabled in the previous step.

Get App Role ID

Run:

...and make note of the role_id in the response.

Example response:

Create Secret

Run:

...and make note of the secret_id in the response.

Example response:

Add App Role ID and Secret ID to Admin Console

Add the app role ID and secret ID from the steps above to the Garden Enterprise admin console. If you came here from the Initialize Bundled Vault step of the installation guide, you can now proceed with the installation.

Last updated

Was this helpful?