Tenant Creation for Multi-tenant CX
Non-MTT Components (Per Tenant)
To deploy CX Campaigns Studio, Conversation Studio, and QM Backend for the new tenant, use the mtt-single Helm chart.
You have to disable Campaigns Studio, Conversation Studio & QM-Backend from existing charts or custom values, by first setting the enabled key to false for these components in their respective charts.
enabled : false
For QM Backend, we need to manually create the PostgreSQL database first. The steps to create the database are mentioned in this guide.
First you need to create the namespace for new tenant
kubectl create namespace <tenant-name>
You have to transfer the Mongo, Redis, PostgreSQL Certificates from the ef-external namespace to newly created tenant namespace.
please change <namespace> with the specific tenant namespace.
kubectl get secret mongo-mongodb-ca -n ef-external -o yaml | sed 's/namespace: ef-external/namespace: <namespace>/' | kubectl create -f -
kubectl get secret redis-crt -n ef-external -o yaml | sed 's/namespace: ef-external/namespace: <namespace>/' | kubectl create -f -
kubectl get secret ef-postgresql-crt -n ef-external -o yaml | sed 's/namespace: ef-external/namespace: <namespace>/' | kubectl create -f -
kubectl get configmap ef-logback-cm -n expertflow -o yaml | sed 's/namespace: expertflow/namespace: <namespace>/' | kubectl create -f -
kubectl get configmap ef-cx-efconnections-cm -n expertflow -o yaml | sed 's/namespace: expertflow/namespace: <namespace>/' | kubectl create -f -
kubectl get secret ef-gitlab-secret -n expertflow -o yaml | sed 's/namespace: expertflow/namespace: <namespace>/' | kubectl create -f -
Customise values.yaml
Update namespace and apply MTT-single helm chart
helm upgrade --install --namespace <tenant-ns> --debug <tenant-id> --values=helm/MTT-single/values.yaml helm/MTT-single
CX Reporting
Configure TLS connection for MySQL
Each tenant has their dedicated namespace where the respective commands will be deployed.
Get the MySQL key-store (.jsk) & certificate(.cert) files for mysql. The .jsk file is required for configuration of the reporting connector, whereas the .cert file is required for Apache Superset SSL configuration. Skeleton Project (cim-solution) already contains the default .jks files in the keystore directory. Replace the mykeystore.jks file acquired with the actual file in cim-solution/kubernetes/pre-deployment/reportingConnector/keystore/ directory.
Create keystore.jks used for MySQL TLS
kubectl create configmap -n <tenant-namespace> ef-reporting-connector-keystore-cm --from-file=pre-deployment/reportingConnector/keystore/mykeystore.jks
Create directory with <tenant_config_directory> in pre-deployment/reportingConnector/<tenant_config_directory> and place reporting-connector.conf specific to each tenant and set the mysql_dbms_additional_params value as shown below.
mkdir pre-deployment/reportingConnector/<tenant_config_directory>
mysql_dbms_additional_params=noDatetimeStringSync=true&useSSL=true&requireSSL=true&trustServerCertificate=true&clientCertificateKeyStoreUrl=file:///root/config/certs/mykeystore.jks&clientCertificateKeyStorePassword={KEYSTORE_PASSWORD}
# Replace the {KEYSTORE_PASSWORD} with your original keystore password. Use "changeit" in case of default password.
Reporting Connector Config-Map Setup
For database creation on MTT, refer to the pre-requisite of EF Data Platform Guide
Create the database in target Database Management System using the scripts from CX-4.10/kubernetes/pre-deployment/reportingConnector/dbScripts/dbcreation directory. Name of each database will be varied from tenant to tenant.
Update the config present in pre-deployment/reportingConnector/<tenant_config_directory>/reporting-connector.conf as per the below mentioned parameters
Parameter | Requirement |
|---|---|
fqdn | Use (FQDN) of the CX Solution specific to each tenant. |
svc_name | http://ef-cx-historical-reports-svc.expertflow.svc.cluster.local:8081 |
tenant_id | unique identifier for each tenant In case of MTT, the tenant_id will be the name of tenant, for on-prem, tenant_id will be expertflow |
browser_language | en-US or ar |
connection_type | mysql or mssql |
sql_dbms_server_ip | mysql.ef-mysql.svc.cluster.local |
sql_dbms_port | for mysql 3306 / for msql 1433 |
sql_dbms_username | <username> |
sql_dbms_password | <password> |
sql_database_name | <database name specific to each tenant> |
In case of MTT, Update the following parameters as well | |
conversation_manager_db_name | <tenant_id> |
bot_framework_db_name | <tenant_id> |
ccm_db_name | <tenant_id> |
routing_engine_db_name | <tenant_id> |
cim_customer_db_name | <tenant_id> |
business_calendars_db_name | <tenant_id> |
state_events_logger_db_name | <tenant_id> |
admin_panel_db_name | <tenant_id> |
Apply configuration for Reporting-Connector on the desired tenantâs namespace
please create a directory for each tenant for MTT
mkdir -p pre-deployment/reportingConnector/<tenant_config_directory>
Please copy this file in this directory
cp -r pre-deployment/reportingConnector/reporting-connector.conf pre-deployment/reportingConnector/<tenant_config_directory>/reporting-connector.conf
Edit this file according to your configuration
vi pre-deployment/reportingConnector/<tenant_config_directory>/reporting-connector.conf
Apply this file after updating <tenant_config_directory> and namespace
kubectl -n <tenant-namespace> create configmap ef-reporting-connector-conf-cm --from-file=pre-deployment/reportingConnector/<tenant_config_directory>/reporting-connector.conf
Customise values.yaml
Deploy the Reporting Scheduler
helm upgrade --install --namespace <tenant-namespace> --set global.efCxReleaseName="ef-cx" cx-reporting --debug --values helm/Reporting/values.yaml helm/Reporting
Expertflow ETL
Follow the below steps to configure a new tenant for data platform
Database Setup
For MYSQL
Edit the file
kubernetes/pre-deployment/reportingConnector/dbScripts/dbcreation/_historical_reports_db_creation_script_MySQL.sqland update the following then executeCODE-- ---------------------------------------------------------------------------- -- NOTE : CX-4.9 creation script -- ---------------------------------------------------------------------------- SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------------------------------------------------------- -- ---------------------------------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `<tenant-name>`; USE `<tenant-name>`; -- In case of username other then 'root', update the following with current database username (at line 396) CREATE DEFINER=<username>@% PROCEDURE InsertWeekDays(IN start_year INT, IN end_year INT ,IN week_start_day VARCHAR(10))
For MSSQL
Edit the file
kubernetes/pre-deployment/reportingConnector/dbScripts/dbcreation/_historical_reports_db_creation_script_MSSQL.sqland update the following then executeCODEUSE master GO IF NOT EXISTS ( SELECT [name] FROM sys.databases WHERE [name] = N'<tenant-name>' ) CREATE DATABASE "<tenant-name>" COLLATE SQL_Latin1_General_CP1_CI_AS GO USE "<tenant-name>" GO
Ensure that the executing user has sufficient privileges to create databases and tables.
Transflux
Edit the file transflux/config/tenants/tenants.yaml and add the following configuration
In order to register new tenants, replicate the previous tenant configuration and append the new settings afterwards, set the
TARGET_TYPEas per the dedicated target database and configure the database credentials accordingly. You can also update the existing tenant's information as per the following setupCODE<tenant_name>: mongodb: SOURCE_HOST: "mongo-mongodb.ef-external.svc" SOURCE_PORT: "27017" SOURCE_USERNAME: "root" SOURCE_PASSWORD: "Expertflow123" SOURCE_TLS_ENABLED: true SOURCE_DATABASE: "<tenant_name>" postgre: SOURCE_HOST: "ef-postgresql.ef-external.svc" SOURCE_PORT: "5432" SOURCE_USERNAME: "sa" SOURCE_PASSWORD: "Expertflow123" SOURCE_DATABASE: "<tenant_name>" api: FQDN_URL: "https://<tenant_name>.expertflow.com" REALM: "<tenant_name>" TARGET_TYPE: "mysql" MYSQL: TARGET_HOST: "82.208.20.221" TARGET_PORT: "30801" TARGET_USERNAME: "root" TARGET_PASSWORD: "Expertflow123$#" TARGET_SSL_ENABLED: false TARGET_DATABASE: "<tenant_name>" MSSQL: TARGET_HOST: "192.168.1.77" TARGET_PORT: "1433" TARGET_USERNAME: "sa" TARGET_PASSWORD: "Expertflow464" TARGET_SSL_ENABLED: false TARGET_DATABASE: "<tenant_name>"
Create configuration ConfigMaps for CX-Transflux pipelines with multi-tenancy configurations.
kubectl -n expertflow delete configmap ef-transflux-config-cm
kubectl -n expertflow create configmap ef-transflux-config-cm --from-file=config/tenants
helm upgrade --install --namespace expertflow --set global.efCxReleaseName="ef-cx" cx-transflux --debug --values helm-values/cx-transflux-custom-values.yaml expertflow/transflux
Rasa
For Rasa Multitenancy deployment use this guide
Tenant Onboarding
This section provides the required steps and references for onboarding new tenants after completing the CX deployment.