Configuring an external database for Measure and Release
You can configure Measure and Release to use an external MongoDB database by creating a Kubernetes secret to store the database connection URL and updating the Helm chart to reference this secret.
Before you begin
You must have completed following tasks:
- Ensured a running MongoDB instance is available.
- Ensured that the following information is available:
MONGO_HOSTMONGO_PORTMongo_DATABASEMongo_USERMongo_PASSWORD
-
Ensured that the database user has the permission to access the required database.
Procedure
-
Create a Kubernetes secret
mongodb-url-secretin the target namespace, storing the MongoDB connection URL as the password.MONGO_HOST=<mongo-host> MONGO_PORT=3306 MONGO_DATABASE=<database-name> MONGO_USER=<database-name> MONGO_PASSWORD=<password> MONGO_URL="mongodb://${MONGO_USER}:${MONGO_PASSWORD}@${MONGO_HOST}:${MONGO_PORT}/${MONGO_DATABASE}" kubectl create secret generic mongodb-url-secret --namespace ${NAMESPACE} \ --from-literal=password="${MONGO_URL}" -
Add the following to the
HELM_OPTIONSsection of the installation script to reference the MongoDB secret:--set hcl-ucv-prod.secrets.database=mongodb-url-secret