﻿# Install Full-Text Search services in Kubernetes using a Helm package

> [HTML Version](full-text-search-in-kubernetes.html)

Installing OpenSearch and the **fulltextsearcher** and **textextractor** services in Kubernetes using a Helm package includes the following steps:

1. [Download the Helm chart and configuration file](#install-helm-chart).

2. [Fill in the configuration file](#fill-configuration-file).

3. [Install the brix365-dbs chart in the Kubernetes cluster using Helm](#install-elma365-dbs).

4. [Connect to the OpenSearch service](#connect-to-opensearch).

5. [Apply full-text search settings for BRIX](#apply-parameters).

## Step 1. Download the Helm chart and configuration file

To install via the internet, obtain the `values-brix365-dbs.yaml` configuration file by running:

````
helm repo add brix365 https://charts.brix365.com  
helm repo update  
helm show values brix365/brix365-dbs > values-brix365-dbs.yaml

````
Obtaining the configuration file for installation in a closed environment without internet access

1. On a computer with internet access, download the BRIX images and upload them to your local image registry. For details, see [Download BRIX images](downloadin-images-elma365.md). Then run the following command:

````
helm repo add brix365 https://charts.brix365.com  
helm repo update  
helm pull brix365/brix365-dbs

2. ````
 Copy the downloaded `brix365-dbs-X.Y.Z.tgz` chart archive to the server where the installation will be performed.

3. Extract the chart and copy the default configuration file `values.yaml` в `values-brix365-dbs.yaml`:

````
tar -xf brix365-dbs-X.Y.Z.tgz  
cp brix365-dbs/values.yaml values-brix365-dbs.yaml
````

## ````
Step 2. Fill in the configuration file

The OpenSearch service can be installed together with the **brix365-dbs** chart or separately in another `namespace`. Below is an example of configuring the `values-brix365-dbs.yaml` file to install OpenSearch:

1. In the `global` section, enable `OpenSearch` for the opensearch component by setting the `enabled` parameter:

````
\# Select databases to install.  
global:  
  opensearch:  
    # Install opensearch (Enabled for fulltextsearcher)  
    enabled: true

2. ````
If necessary, specify `OPENSEARCH\_INITIAL\_ADMIN\_PASSWORD` in the OpenSearch configuration and set a password for the **admin** user:

````
\# Select databases to install.  
global:  
...  
\# Opensearch settings (Enabled for fulltextsearcher)  
opensearch:  
\# cluster Mode — disable singleNode  
  singleNode: true  
  extraEnvs:  
    - name: OPENSEARCH\_INITIAL\_ADMIN\_PASSWORD  
      value: 123456ASdlkjqweq  
    - name: "plugins.security.ssl.http.enabled"  
       value: "false"  
  config:  
    opensearch.yml: |  
      network.host: '\*'  
  persistence:  
    enabled: true  
    size: 10Gi  
  # storageClass: "-"  
...

3. ````
To configure high availability, switch the `singleNode` parameter:

````
\# Select databases to install.  
global:  
...  
\# Opensearch settings (Enabled for fulltextsearcher)  
opensearch:  
...  
  # cluster Mode - disable singleNode  
  singleNode: false  
...

4. ````
To install the **brix365-dbs** chart in a closed environment without internet access, configure the connection parameters for the private **registry**.

Example of configuring parameters for a private registry connection

1. Specify the address and path to the private **registry** in the `opensearch.persistence.image` parameter for the initialization container.

2. Specify the address and path to the private **registry** in the `opensearch.image.repository` parameter.

3. Manually create a secret with access credentials for the private **registry** and encode it in Base64.

4. Enter the name of the created secret in the `opensearch.image.pullSecrets` parameter.



````
\# Select databases to install  
global:  
...  
\# Postgres db settings  
opensearch:  
...  
  # Enable initialization container  
  # he container changes the owner and group of the volume mount point to \`RunAsUser:fsGroup  
  persistence:  
    enabled: true  
    # address and secret for the private registry of the initialization container image  
    image: registry.example.com  
...  
  # address and secret for the private registry  
  image:  
    repository: registry.example.com/opensearch  
    # secret with credentials for private registry must be created manually and encoded in Base64  
    pullSecrets:  
      - myRegistryKeySecretName  
...

````
where the format of `repository `is:

- address — `registry.example.com`;

- path — `/opensearch`.

## Step 3. Install the brix365-dbs chart in the Kubernetes cluster using Helm

Install the `brix365-dbs` chart in `namespace brix365-dbs`:

- For installation via the internet:

````
helm upgrade --install opensearch brix365/brix365-dbs -f values-brix365-dbs.yaml -n opensearch --create-namespace

- ````
For installation without internet access, navigate to the directory with the downloaded chart and run:

````
helm upgrade --install opensearch ./brix365-dbs -f values-brix365-dbs.yaml -n opensearch --create-namespace

## ````
Step 4. Connect to the OpenSearch service

1. Create a backup of the existing `values-brix365.yaml` configuration file that was obtained and completed during the BRIX installation. This helps prevent service disruption if configuration changes are made incorrectly.

2. Update the existing `values-brix365.yaml` configuration file:

- enable parameters `global.extensions.name.fulltextsearcher.enabled` and `global.extensions.name.textextractor.enabled` by setting them to `true`;

- configure the OpenSearch connection in the `global.extensions.opensearch` parameter.

````
global:  
  ...  
  extensions:  
\# enable full-text search using OpenSearch  
    - name: fulltextsearcher  
      enabled: true  
\# requires OpenSearch connection settings  
      opensearch:  
        addresses: "http://opensearch-cluster-master.opensearch.svc.cluster.local:9200/"  
        login: "admin"  
        password: "123456ASdlkjqweq"  
        textExtractorURL: "http://textextractor:3000/"  
        itemsTransferPerIteration: 400  
        itemsWorkers: 4  
        taskWorkers: 1  
\# enable module for text extraction from office documents  
    - name: textextractor  
      enabled: true  
...

## ````
Step 5. Apply full-text search settings

Update the BRIX application settings using the `values-brix365.yaml` configuration file

To update settings via the internet:

1. Determine the chart version used to install BRIX by running:

````
helm show chart brix365/brix365

````
Example:

**[![full-text-search-in-kubernetes-1](full-text-search-in-kubernetes-1.png)]**

The `version` field indicates the chart version used to install BRIX.

2. Run the update command, specifying the installed BRIX chart version::

````
helm upgrade --install brix365 brix365/brix365 -f values-brix365.yaml --version <brix365-chart-version> --timeout=30m --wait \[-n namespace\]

````
Instead of `<brix365-chart-version>)` for flag `–version` specify the chart version obtained at the previous step.

Updating parameters without internet access

1. Go to the catalog with the BRIX chart and run:

````
helm upgrade --install brix365 ./brix365 -f values-brix365.yaml --timeout=30m --wait \[-n namespace\]

2. ````
Parameter update takes from 10 to 30 minutes. Wait for it to be completed.

## Remove the OpenSearch chart from the Kubernetes cluster Using Helm

To remove the OpenSearch chart from `namespace opensearch`, run:

````
helm uninstall opensearch -n opensearch
````