One of the steps for preparing BRIX infrastructure is to configure proxying of database queries. For this purpose, you can use the DB‑Gateway tool.
It provides access to the Redis, RabbitMQ, PostgreSQL, and MinIO databases via an entry point in the Kubernetes cluster. This simplifies the process of connecting to and working with databases, and optimizes the number of infrastructure components required to configure proxying.
DB‑Gateway installation consists of the following steps:
- Download the helm-chart and the configuration file.
- Fill out the configuration file.
- Install the DB-Gateway chart using Helm in the Kubernetes cluster.
- Connect to databases.
Step 1: Download the helm-chart and the configuration file
To install via the internet, obtain the values-dbgateway.yaml configuration file by running the command:
helm repo add elma365 https://charts.elma365.tech
helm repo update
helm show values elma365/dbgateway > values-dbgateway.yaml
Obtaining the configuration file for installation in an isolated environment without internet access
| 
 helm repo add elma365 https://charts.elma365.tech 
 tar -xf dbgateway-X.Y.Z.tgz | 
Step 2: Fill out the configuration file
Fill out the values-dbgateway.yaml configuration file for DB‑gateway installation:
- In the ingress.hostname parameter, set the domain (FQDN) or the IP address of the BRIX application.
- In the ingress.pathparameter, set the bucket name (in the database storage) where the BRIX files are stored.
 The bucket name in the database must correspond to the DBelma365 format.
Начало примера
Example:
- DBelma365.
- DBelma365-dev.
- DBelma365-prod.
конец примера
- The following changes should be made to the configuration file if the BRIX application web-interface is accessible via HTTPS:
- In the ingress.hostnameparameter, set the domain (FQDN).
- In the ingress.ingressClassNameparameter, set the name of the ingress controller class.
- Enable TLS support by setting theingress.tlsparameter totrue.
- Uncomment the parameters of the ingress.extraTlssection.
- For the ingress.extraTls.hostsparameter, set the domain (FQDN) where the BRIX application is available.
- For the ingress.extraTls.secretNameparameter, set thesecretname of thetlstype for the domain specified iningress.extraTls.hosts.
- If high availability is provided, set the required number of replicas in the replicaCountparameter.
- In the configuration parameter, the HAProxy configuration is specified with which this tool will run in the Kubernetes cluster. In the backend DB_mainsection of the HAProxy configuration, specify the list of database servers to which user traffic will be redirected.
How to configure HAProxy to proxy connection to a database repository
|     
 | 
- If you install DB-Gateway chart in an isolated environment without internet access, fill out the connection parameters for the private registry.
How to fill out the connection parameters for the private registry
| 
 # HAProxy settings for proxying connection to the database storage 
 | 
Step 3: Install the DB-Gateway chart using Helm in the Kubernetes cluster
Install the DB-Gateway chart in the namespace dbgateway.
To install via the internet, run the command:
helm upgrade --install dbgateway elma365/dbgateway -f values-dbgateway.yaml -n dbgateway --create-namespace
To install without internet access, run the command:
helm upgrade --install dbgateway ./dbgateway -f values-dbgateway.yaml -n dbgateway --create-namespace
Step 4: Connect to databases
In the values-elma365.yaml configuration file, fill out the parameters for BRIX application to connect to databases via the configured DB‑Gateway:
- Parameters for connecting to MinIO:- address— specify- elma365-server.your_domain.
- bucket,- region,- access key ID,- secret access key,- upload methodи- enable SSL— specify values according to the parameters of the DB storage for which proxying is configured.
 
- Parameters for connecting to Redis:
elma365.db.redisUrl — 'redis://:SecretPassword@redis.dbgateway.svc.cluster.local:6379/0';
- Parameters for connecting to RabbitMQ:
elma365.db.amqpUrl — 'amqp://elma365user:SecretPassword@rabbitmq.dbgateway.svc.cluster.local:5672/0'
elma365.db.amqpManagementUrl — 'http://rabbitmq-stats.dbgateway.svc.cluster.local:15672';
- Parameters for connecting to PostgreSQL:
elma365.db.psqlUrl — 'postgresql://elma365user:SecretPassword@postgresql.dbgateway.svc.cluster.local:5000/elma365?sslmode=disable'
elma365.db.roPsqlUrl — 'postgresql://elma365user:SecretPassword@postgresqlro.dbgateway.svc.cluster.local:5001/elma365?sslmode=disable';
Read how to fill out these parameters in the Modify BRIX Enterprise parameters article.
Found a typo? Select it and press Ctrl+Enter to send us feedback