External Secrets from Hashicorp Vault | HiveMQ Platform Operator (new)
This article explains how to fetch secrets from an external Hashicorp Vault and put them into Kubernetes secrets required for the HiveMQ Platform, such as license, keystore, and truststore.
Instructions
First, ensure you have the VAULT_ADDR and VAULT_TOKEN from the external vault at hand.
Next, put your secrets in the vault. In this article, we store files in the vault encoded with base64.
Install External Secrets Kubernetes Operator
Add the repo to the Helm:
helm repo add external-secrets https://charts.external-secrets.io
Install
external-secrets/external-secrets
in the same namespace as HiveMQ Platform.Create the secret required for the external-secrets to access the external vault. The secret should contain the VAULT_TOKEN. In our article, the token is
root
OR
Create the Secret Store required for the external-secrets to access the external vault. The definition should contain the vault URL and reference to the secret with the token, and also the path (path in the kv-2 engine in the external vault from which the token is allowed to read)
Now the external-secrets should be able to access the external vault successfully
Create an external-secret that will fetch the keystore from the external vault and put it to the Kubernetes secret
hivemq-keystore-v
, keykeystore
.Apply the rest of the external secrets manifests in the same fashion:
If everything works, the following Kubernetes Secrets will be created automatically:
Install HiveMQ Platform
Now, update the HiveMQ Platform values.yaml and configure that license, keystore, trustore, and their passwords are taken from relevant secrets.
Specify that the license should be taken from the secrethivemq-license-v
Specify that the keystore should be taken from the secret
hivemq-keystore-v
Example HiveMQ Platform values.yaml:
Install the HiveMQ Platform Operator and HiveMQ Platform
Check the HiveMQ broker stateful set logs to make sure the license, keystore and trustore are applied correctly.