BRIX On-Premises > Prepare infrastructure > Load balancer / Proxying databases in Kubernetes via DB-Gateway

Proxying databases in Kubernetes via DB-Gateway

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:

  1. Download the helm-chart and the configuration file.
  2. Fill out the configuration file.
  3. Install the DB-Gateway chart using Helm in the Kubernetes cluster.
  4. 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

Step 2: Fill out the configuration file

Fill out the values-dbgateway.yaml configuration file for DB‑gateway installation:

  1. In the ingress.hostname parameter, set the domain (FQDN) or the IP address of the BRIX application.
  2. In the ingress.path parameter, 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.

конец примера

  1. The following changes should be made to the configuration file if the BRIX application web-interface is accessible via HTTPS:
  • In the ingress.hostname parameter, set the domain (FQDN).
  • In the ingress.ingressClassName parameter, set the name of the ingress controller class.
  • Enable TLS support by setting theingress.tls parameter to true.
  • Uncomment the parameters of the ingress.extraTls section.
  • For the ingress.extraTls.hosts parameter, set the domain (FQDN) where the BRIX application is available.
  • For the ingress.extraTls.secretName parameter, set the secret name of the tls type for the domain specified in ingress.extraTls.hosts.
  1. If high availability is provided, set the required number of replicas in the replicaCount parameter.
  2. In the configuration parameter, the HAProxy configuration is specified with which this tool will run in the Kubernetes cluster. In the backend DB_main section 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

  1. 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

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.