CX Deployment on Kubernetes
This document illustrates the procedure and steps to deploy Expertflow CX-core on Kubernetes.
Before you begin, verify
- Installed Kubernetes. If not, see Deployment Planning
- Have already setup storage. If not yet, see Storage Solution - Getting Started
Prepare for CX Deployment
Step 1: Clone the Expertflow CX repository
git clone -b CX-4.4 https://efcx:RecRpsuH34yqp56YRFUb@gitlab.expertflow.com/cim/cim-solution.git
cd cim-solution/kubernetes
Step 2: Create Namespaces
Create a namespace
expertflow
for all Expertflow components
Run the following command on the control-plane node.
kubectl create namespace expertflow
Create a namespace
ef-external
for all the external elements of the Expertflow CX solution such as Mongo, Redis, MinIO, etc.
Run the following command on the control-plane node.
kubectl create namespace ef-external
Step 3: Apply Image Pull secret
Run the following commands for applying ImagePullSecrets of Expertflow CX images.
kubectl apply -f pre-deployment/registryCredits/ef-imagePullSecret-expertflow.yaml
kubectl apply -f pre-deployment/registryCredits/ef-imagePullSecret-ef-external.yaml
Step 4: Update FQDN
Expertflow CX should be accessible by a fully qualified domain name. Assign the FQDN that resolves to the control plane node or KubeVIP.
Replace <FQDN> with your FQDN for Expertflow CX and run this command.
sed -i 's/devops[0-9]*.ef.com/<FQDN>/g' cim/ConfigMaps/* pre-deployment/grafana/* pre-deployment/keycloak/* cim/Ingresses/nginx/* cim/Ingresses/traefik/*
Setup SQL Database
Expertflow CX requires any of the following PostgreSQL for Expertflow CX deployment for storing configuration data.
PostgreSQL RECOMMENDED |
Skip this step if you already have any of the other two databases in your environment.
|
---|
Deploy CX External Components
Expertflow CX requires the following 3rd party components.
Redis | Key-Values based Caching engine, used by most of the EF-CX components. |
---|---|
MongoDB | NoSQL Database, maintains and serves as primary back store for EF-CX solution. |
Minio | S3 compliant object storage. |
KeyCloak | Realm based auth management tool. |
You may use them from your existing environment or from a cloud provider .
Setup KeyCloak
KeyCloak is used as the centralized authentication and authorization component for Expertflow CX. Follow these steps to setup KeyCloak.
On the master node, create a global ConfigMap for KeyCloak. Change the hostname and other parameters before applying this command in
ef-keycloak-configmap.yaml
file:BASHkubectl apply -f pre-deployment/keycloak/ef-keycloak-configmap.yaml
Now, deploy KeyCloak by running the following command
BASHhelm upgrade --install=true --wait=true --timeout=10m0s --debug --namespace=ef-external --values=external/bitnami/keycloak/values.yaml keycloak external/bitnami/keycloak/
Check the KeyCloak installation status. You can check the status of deployment by using the following command:
BASHkubectl -n ef-external rollout status sts keycloak
Setup MongoDB
Expertflow CX using MongoDB for storing all CX events, activities, and some configuration data as well.
Skip this step if you already have MongoDB in your environment that can be used by Expertflow CX. For using MongoDB from a managed environment, see Using Managed MongoDB for necessary configurations.
Deploy MongoDB by running the following command.
BASHhelm upgrade --install=true --wait=true --timeout=10m0s --debug --namespace=ef-external --values=external/bitnami/mongodb/values.yaml mongo external/bitnami/mongodb/
Check the MongoDB deployment status by running the following command:
BASHkubectl -n ef-external rollout status sts mongo-mongodb
Setup MinIO
Expertflow CX using MinIO for storing files exchanged between agents, customers, and/or bots. Install using Helm using following command:
helm upgrade --install=true --wait=true --timeout=10m0s --debug --namespace=ef-external --values=external/bitnami/minio/values.yaml minio external/bitnami/minio/
kubectl apply -f scripts/minio-helper.yaml
kubectl -n ef-external --timeout=90s wait --for=condition=ready pod minio-helper
kubectl -n ef-external cp post-deployment/data/minio/bucket/default minio-helper:/tmp/
kubectl -n ef-external cp scripts/icon-helper.sh minio-helper:/tmp/
kubectl -n ef-external exec -it minio-helper -- /bin/sh /tmp/icon-helper.sh
kubectl delete -f scripts/minio-helper.yaml
Setup Redis
CX uses Redis for storing active system state of most of the CX objects. Run the following command to deploy Redis.
helm upgrade --install=true --wait=true --timeout=10m0s --debug --namespace=ef-external --values=external/bitnami/redis/values.yaml redis external/bitnami/redis/
Setup Realtime Reports
Expertflow CX uses Grafana for business and solution monitoring. Business monitoring dashboards are embedded inside AgentDesk that provide real-time statistics for both agents and supervisors.
See Setup Grafana for embedded dashboards for details.
Setup Historical Reports
Expertflow CX uses Apache Superset for historical reports.
Setup Rasa for AI
See RASA-X Deployment for how to use Rasa for 3rd party bot assistance.
Setup ActiveMQ
Expertflow CX uses ActiveMQ for message queuing between CX core components. To deploy ActiveMQ as a StatefulSet run
kubectl apply -f cim/StatefulSet/ef-amq-statefulset.yaml
Wait for the AMQ StatefulSet to be ready
kubectl wait pods ef-amq-0 -n ef-external --for condition=Ready --timeout=600s
Deploy CX-Core Components
CX Conversation Controller controls all conversations. See Controller Scripting Guide for details.
Setup default translation file for AgentDesk.
CODEkubectl -n expertflow create configmap ef-app-translations-cm --from-file=pre-deployment/app-translations/unified-agent/i18n
Apply Conversation Controller ConfigMaps
BASHkubectl -n expertflow create configmap ef-conversation-controller-actions-cm --from-file=pre-deployment/conversation-Controller/actions kubectl -n expertflow create configmap ef-conversation-controller-actions-utils-cm --from-file=pre-deployment/conversation-Controller/utils kubectl -n expertflow create configmap ef-conversation-controller-actions-pycache-cm --from-file=pre-deployment/conversation-Controller/__pycache__
Apply all configurations in the ConfigMaps folder using:
CODEkubectl apply -f cim/ConfigMaps/
Create services for all deployment EF components
CODEkubectl apply -f cim/Services/
Apply all the Deployment manifests
CODEkubectl apply -f cim/Deployments/
Before proceeding to the the next steps, wait for all the solution components to be up and ready.
BASHkubectl -n expertflow get pods
Team Announcement CronJob
Run the following command to setup team announcement CronJob.
It requires the solution be up and running.
kubectl apply -f pre-deployment/team-announcement/
Setup SSL Certificates
Expertflow CX ships with self-signed certificates for all the ingresses. To use your own SSL certificates you will need to generate a secret with the certificate files. You must have private.key
and server.crt
files in pre-deployment/certificates
.
For
expertflow
namespace:CODEkubectl -n expertflow create secret tls ef-ingress-tls-secret \ --key pre-deployment/certificates/server.key \ --cert pre-deployment/certificates/server.crt
For
ef-external
namespace:CODEkubectl -n ef-external create secret tls ef-ingress-tls-secret \ --key pre-deployment/certificates/server.key \ --cert pre-deployment/certificates/server.crt
Setup Ingress Routes
For RKE2-based Ingresses using Ingress-Nginx Controller
kubectl apply -f cim/Ingresses/nginx/
K3S based deployments are deprecated and will not be supported in the future releases
For K3S based Ingresses using Ingress-Traefik Controller
kubectl apply -f cim/Ingresses/traefik/
Configurations
Import default keyCloak realm for essential KeyCloak resources, permissions, and authentication configurations.
Configure and import historical report templates in Apache Superset.
For customer channel configuration, see customer channels.
For Rasa configuration, follow this guide.
For CX-Voice Component deployment this guide.
For CRM Events deployment follow this guide
Customer Widget configuration
Create a pre-chat form in unified admin. Refer to this guide.
For Customer Identification in CX via customer widget click here.
The customer widget is now capable of calling the deployment of CIM from within the URL
CODEhttps://{FQDN}/customer-widget/#/widget?widgetIdentifier=<widget-identifier>&serviceIdentifier=<service-identifier>
For the chat history, use the following URL
CODEhttps://{FQDN}/customer-widget/widget-assets/chat-transcript/