Skip to main content
Skip table of contents

Helm Charts for Expertflow CX Solution - Developer Edition

Instructions for Developers

Component Chart 

A general Chart  has a hierarchy like below

chart-name/
├── charts
├── Chart.yaml
├── templates
│   ├── configmap.yaml
│   ├── deployment.yaml
│   ├── _helpers.tpl
│   ├── hpa.yaml
│   ├── ingress.yaml
│   ├── NOTES.txt
│   ├── serviceaccount.yaml
│   └── service.yaml
└── values.yaml

Chart.yaml contains metadata about the chart, like its version, appVersion and related information. Whenever there is a change in the application , the appVersion is incremented using semantic versioning. The chart version is incremented when there is a change in the chart. In simpler words a single appVersion can be maintained across different chart version and vice a versa 

templates directory contains actual deployment contents for the component, with every single file being evaluated by a certain variable or function in the values file ( details given below )

values.yaml file for component is main file where end-user is allowed to change/update their required parameters and based on those evaluations are made when generating templates.

Meta Chart ( ef-cx )

For Expertflow Solution, a global Chart is created which on its own doesn't do any thing except it 

  • Create a generic FQDN variable which will be used across all the sub-charts 

  • defines a global registry variable to provide offline deployments

  • creates commonEFConnection configmap which is populated in component charts where needed.

  • creates Image Pull Secret for the images to be pulled from a certain registry

  • creates SSL certificate as secrete required for all ingress routes.

  • declares sub-charts.

details are given below for actions performed by the meta-chart.( values.yaml ).

Generally, below given parameters are evaluated when the Chart is deployed.

{{ .Release.Name }} is replaced with the release name of the helm install command

{{ .Release.Namespace }} refers to the current namespace where the solution is to be deployed.

{{ .Values.global.ingressRouter }} will be replaced with the corresponding value from the values.yaml file.

Global Chart Details

In addition to sub-chart details, below given are the details for this meta chart. Any key:value pair present in this file supersedes the values file in sub-chart's values file.

Section

Item

Details

default

global

ingressRouter

FQDN used for the EF-CX Solution

“devops.ef.com”

imageRegistry

default container registry to pull images from

"gitimages.expertflow.com"

ingressCertName

default ingress certificate secret name. must be created before install

"ef-ingress-tls-secret"

ingressClassName

ingress class name

“nginx”

commonIngressAnnotations

common annotations for all ingress resources

““

efCommonVars_IS_WRAP_UP_ENABLED

Common Environment Variable

true

efCommonVars_WRAPUP_TIME

Common Environment Variable

"60"

efCommonVars_DEFAULT_ROOM_NAME

Common Environment Variable

CC

efCommonVars_DEFAULT_ROOM_LABEL

Common Environment Variable

CC

efCommonVars_DEFAULT_ROOM_DESCRIPTION

Common Environment Variable

Contact Center Room

efCommonVars_CONVERSATION_SEARCH_WINDOW_HRS

Common Environment Variable

"24"

efCommonVars_TZ

Common Environment Variable

UTC

efCommonVars_MASK_ATTRIBUTES_PATH

Common Environment Variable

/sensitive.js

efCommonVars_LOGGING_CONFIG

Common Environment Variable

/logback/logback-spring.xml

efCommonVars_ROOM_IS_USER_ID

Common Environment Variable

false

clusterDomain

root domain for the cluster DNS

“cluster.local”

imageCredentials

registry

container image registry, must be same as global.imageRegistry

gitimages.expertflow.com

username

username for the registry

efcx

password

password for the user of the registry

RecRpsuH34yqp56YRFUb

email

email address for the registry config

devops@expertflow.com

efConnectionVars

Contains list of all the sub-charts related connection parameters

list of parameters.

sub-chart

enabled

enable of disable a sub-chart deployment. true | false

true

Image Pull Secret is created at runtime based on these variables, a valid dockerconfig in JSON format is created at runtime and added to the kubernetes engine as secret with the name of ef-gitlab-secret

All sub-charts are named after the component name  for which it is developed and its values are evaluated from its values.yaml file 

Create a new sub-chart

All sub-charts and their corresponding values.yaml files are present for validation purposes. All values are being inherited from the global chart’s values.yaml file, nothing is implemented at the sub-chart level.

To create a new sub chart, copy the kubernetes/helm/TEMPLATE folder as the target component name. Replace all the occurences of <COMPONENET-NAME> to appropriate name.

CODE
cd cim-solution/kubernetes/helm/Core
cp -rvp ../TEMPLATE  charts/<COMPONENT-NAME>  

Update the component details

CODE
sed -i -e  's@___COMPONENT___NAME___@<COMPONENET-NAME>@g'  charts/<COMPONENT-NAME>/values.yaml  charts/<COMPONENT-NAME>/Chart.yaml

Add the component to the global chart’s Chart.yaml with an entry like below:

CODE
  - name: <COMPONENET-NAME>
    version: 1.0.0
    condition: <COMPONENET-NAME>.enabled
    repository: file://charts/<COMPONENET-NAME>

All sub-charts must adhere to semvers conventions used and should be updated whenever there is a change in the chart's structure like env, cm, svc or deployment is changed.

  • Change the version of the chart to next available semver number 

  • update the sub-chart's version in global chart's Chart.yaml

Update the dependancies for the global chart by running

CODE
rm -f Chart.lock charts/*.tgz ;helm dependency update .;helm dependency build .

Sample Chart definition

Sample sub-chart definition
CODE
##############################360-connector##############################
360-connector:
   enabled: true
   replicaCount: 1
   image:
      repository: cim/360-connector
      tag: 4.5.5_f-CIM-14675
   efConnectionVars: true
   efEnvironmentVars: false
   containerPorts:
      - name: "http-360c-8080"
        containerPort: 8080
   extraEnvVars:
      - name: TZ
        value: "{{ .Values.global.efCommonVars_TZ }}"
      - name: LOGGING_CONFIG
        value: '{{ .Values.global.efCommonVars_LOGGING_CONFIG }}'
      - name: MASKING_LAYOUT_CLASS
        value: '{{ .Values.global.efCommonVars_MASKING_LAYOUT_CLASS }}'
      - name: CCM_URL
        value: "http://{{ .Release.Name }}-ccm-svc.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:8081"
      - name: FILE_ENGINE_URL
        value: "http://{{ .Release.Name }}-file-engine-svc.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:8080"
      - name: MASKING_LAYOUT_CLASS
        value: "com.ef.connector360.utility.MaskingPatternLayout"
   service:
      enabled: true
      port: 8080
      portName: "http-360c-8080"
      targetPort: "http-360c-8080"
   ingress:
      enabled: true
      annotations:
        nginx.ingress.kubernetes.io/rewrite-target: /$2
        nginx.ingress.kubernetes.io/use-regex: "true"
      path: /360-connector(/|$)(.*)
      pathType: ImplementationSpecific
   extraVolumes:
      - name: ef-logback
        configMap:
           name: ef-logback-cm
   extraVolumeMounts:
      - name: ef-logback
        mountPath: /logback

Deploy the solution using helm ( local method )

This procedure expects that CX External components are already deployed using CX Deployment on Kubernetes

Clone the repo

CODE
git clone -b CX-4.6-helm-v1  https://efcx:RecRpsuH34yqp56YRFUb@gitlab.expertflow.com/cim/cim-solution.git CX-4.6-helm-v1
cd CX-4.6-helm-v1/kubernetes

Create expertflow namespace

CODE
kubectl create namespace expertflow

Create TLS Certificate for the ingress resources

CODE
kubectl -n ef-external create secret tls ef-ingress-tls-secret  \
--key pre-deployment/certificates/server.key \
--cert pre-deployment/certificates/server.crt  

Transfer the Mongo and Redis Certificates from ef-external namespace

CODE
kubectl get secret mongo-mongodb-ca -n ef-external  -o yaml | sed 's/namespace: ef-external/namespace: expertflow/' | kubectl create -f -
kubectl get secret redis-crt -n ef-external  -o yaml | sed 's/namespace: ef-external/namespace: expertflow/' | kubectl create -f -
kubectl get secret ef-postgresql-crt -n ef-external  -o yaml | sed 's/namespace: ef-external/namespace: expertflow/' | kubectl create -f -

Setup default translation file for Agent Desk

CODE
kubectl -n expertflow  create configmap ef-app-translations-cm --from-file=pre-deployment/app-translations/unified-agent/i18n

Setup default canned messages translations file for Agent Desk

CODE
kubectl -n expertflow  create configmap ef-canned-messages-cm --from-file=pre-deployment/app-translations/unified-agent/canned-messages

Apply CRM ConfigMap for Agent Desk ( Option, only when Agent-Desk embedding in CRM is required )

CODE
kubectl -n expertflow create configmap ef-crm-service-cm --from-file=pre-deployment/crm-service/

Apply Conversation Controller ConfigMaps

CODE
kubectl -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 ConfigMap to enable log masking for all components in expertflow namespace:-

CODE
kubectl apply -f pre-deployment/logback/
kubectl -n expertflow create configmap ef-logback-cm --from-file=pre-deployment/logback/logback-spring.xml

For development purposes, developers can update the global chart’s values.yaml file with the required changes and then deploy the CX solution on their local system using. Replace the <FQDN> with domain.

CODE
cd helm/Core
helm upgrade --install --namespace expertflow --create-namespace  --set global.ingressRouter=<FQDN>   --debug --values values.yaml ef-cx  .

Troubleshooting Steps.

Rendering Helm charts without installing them

As a developer of helm charts, You can also render the changes without installing the helm chart directly by

CODE
helm install --namespace expertflow  --set global.ingressRouter=<FQDN>   --dry-run --debug   "ef-cx"  .

Or Just to render the templates ( inside the chart directory )

CODE
helm template --debug  --values values.yaml .

 there are certain scenarios where the YAML is not rendered correctly ( due to incorrect spaces or tab characters )  You can disable the api-validation using ( inside the chart directory )

CODE
helm install --namespace <namespace>   <release-name>  --dry-run --disable-openapi-validation  --debug --values values.yaml .


Dumping all the rendered manifests to a folder

You can also dump all the generated/rendered manifests into a folder for evaluation using

Check if the Go language is installed on your system

CODE
go version

if go-lang is not installed, you can install the go-lang by following instruction on https://go.dev/doc/install

once go-lang is installed, run this command to fetch the required go module

CODE
go get -u github.com/databus23/schelm

export the required environment variables for go-lang

CODE
export GOPATH=$(go env GOPATH)

add the go-lang in your PATH 

CODE
export PATH=$PATH:$GOPATH/bin

export all the rendered charts into /root/rendered  folder

CODE
helm install --namespace <namespace>   <release-name>  --set global.ingressRouter=<FQDN> --dry-run   --debug .|schelm /root/rendered

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.