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.5 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/
Wait for the minio deployment to get ready
kubectl -n ef-external rollout status deployment minio --timeout=5m
proceed with icons bootstrapping
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 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
Setup default translation file for Agent Desk
CODEkubectl -n expertflow create configmap ef-app-translations-cm --from-file=pre-deployment/app-translations/unified-agent/i18n
Apply CRM ConfigMap for Agent Desk
CODEkubectl -n expertflow create configmap ef-crm-service-cm --from-file=pre-deployment/crm-service/
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 apply your custom / domain-signed SSL certificates see Apply Domain-signed SSL Certificates.
Setup Ingress Routes
For RKE2-based Ingresses using Ingress-Nginx Controller
kubectl apply -f cim/Ingresses/nginx/
Change Service from Cluster IP to NodePort:-
If the user needs to service type from Cluster IP to NodePort on any specific port, the following command be run:-
kubectl patch svc <service name> -n <namespace> --type='json' -p '[{"op":"replace","path":"/spec/type","value":"NodePort"},{"op":"replace","path":"/spec/ports/0/nodePort","value":<port number>}]'
Configurations
Import default keyCloak realm for essential KeyCloak resources, permissions, and authentication configurations.
If you intend to use Apache Superset for reporting, follow Configure and import historical report templates to configure the Reporting solution.
For customer channel configuration, see customer channels.
For CX-Voice component deployment this guide