You can configure Build to use the same external MySQL database that is used by
Deploy. When using an external database, the Build Helm chart must be configured to connect
to the existing MySQL instance instead of creating a database inside the Kubernetes
cluster.
You must have completed the following tasks:
- Ensured that the external MySQL database used by Deploy is available and
accessible from the Kubernetes cluster.
- Ensured that the following information is available:
MySQL host name or IP address
MYSQL port
Database name
Database user name
Database password
-
Ensured that the database user has permission to access the required
database.
-
Ensured that the Kubernetes cluster is connected to the MySQL server.
-
Esnured that a Kubernetes secret containing the database password exists
in the deployment namespace.
-
Add variables for the external MySQL database in the installation script:
MYSQL_HOST=<mysql-host>
MYSQL_PORT=3306
DATABASE_NAME=<database-name>
DATABASE_USER=<database-user>
BUILD_DB_SECRET=build-secret
These variables define the connection details for the external MySQL database
used by the Build.
-
Create a Kubernetes secret that contains the database password by running the
following command:
BUILD_DB_PASSWORD=<DATABASE_PASSWORD>
kubectl create secret generic build-secret -n devops-loop --from-literal=dbpassword="$BUILD_DB_PASSWORD"
⚠️ Important: The BUILD_DB_PASSWORD must match the
password assigned to the MySQL user.
-
Add the following Helm values to the
HELM_OPTIONS section of
the installation script. These parameters configure the Build Helm chart to use
the external database.
HELM_OPTIONS="${HELM_OPTIONS} \
--set ibm-devops-build.externalDB.enabled=true \
--set ibm-devops-build.externalDB.hostname=${MYSQL_HOST} \
--set ibm-devops-build.externalDB.port=${MYSQL_PORT} \
--set ibm-devops-build.externalDB.database=${DATABASE_NAME} \
--set ibm-devops-build.externalDB.user=${DATABASE_USER} \
--set ibm-devops-build.secret.name=${BUILD_DB_SECRET}"
After you run the installation script, DevOps Loop is
installed and the Build capability connects to the external MySQL database by using the
credentials stored in the Kubernetes secret.
You must install DevOps Loop to apply the configuration.
See Installation of DevOps Loop.