HashiCorp Vault
To incorporate secrets from HashiCorp Vault, you need to create a generic Kubernetes secret that will be used for vault authentication. This involves creating a Kubernetes secret in the specific namespace where your application will be deployed. The secret should store the base64-encoded password or token obtained from vault. To simplify the process, you can utilize the Devtron generic chart. An example yaml is given below:
Note: Please note that you don't need to create the Kubernetes secret every time you create an External Secret for the corresponding namespace.
Once you have created the generic secret, follow these steps in the application's Secrets section:
1. Create a new secret
To add a new secret to the application, go to the App Configuration
section of the application. Then, navigate to the left pane and select the Secrets
option and click the Add Secret button.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fcreating-application%2Fsecrets%2Fhc-add-secret.jpg&width=768&dpr=4&quality=100&sign=f9eb88a0&sv=1)
2. Select HashiCorp Vault
as the External Secret Operator
After clicking the Add Secret button, select HashiCorp Vault
from the dropdown menu for the Data type
option. Provide a name for the secret you are creating, and then proceed to configure the external secret as described in the next step.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fcreating-application%2Fsecrets%2Fhc-secret-type.jpg&width=768&dpr=4&quality=100&sign=64fffda9&sv=1)
3. Configure the secret
To configure the external secret that will be fetched from HashiCorp Vault for your application, you will need to provide specific details using the following key-value pairs:
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fcreating-application%2Fsecrets%2Fhc-secret-configure.jpg&width=768&dpr=4&quality=100&sign=760ebf95&sv=1)
Key | Description |
---|---|
| Server is the connection address for the Vaultserver, e.g: "https://vault.example.com:8200" |
| Specify the path where the secret is stored in Vault |
| Enter the name of the secret that will be used for authentication |
| Specify the key name within the secret that contains the token |
| Provide a name for the secret in Kubernetes |
| Enter the name of the secret in Vault |
| Specify the key within the Vault secret |
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fcreating-application%2Fsecrets%2FtokenSecretRef.jpg&width=768&dpr=4&quality=100&sign=8f1babe2&sv=1)
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fcreating-application%2Fsecrets%2Fhc-eso.jpg&width=768&dpr=4&quality=100&sign=d4a2507&sv=1)
4. Save the secret
After configuring the external secret from HashiCorp Vault, proceed to save the secret by clicking the Save button.
By following the steps mentioned above and configuring these values correctly, you can seamlessly fetch and utilize external secrets from HashiCorp Vault within your application environment by deploying the application.
Last updated