Skip to content

Repository files navigation

Botfront Helm Charts

This repo contains 2 charts:

  • botfront: the Botfront platform
  • botfront-project: The Rasa project connected to Botfront,

Both charts need to be installed.

Prerequisites

  • Kubernetes 1.18+
  • Helm 3.4+
  • Persistent volume provisioner support in the underlying infrastructure

Add the repository

helm repo add botfront https://botfront.github.io/botfront-helm

Installation

Botfront

Given that there's quite a few parameters to set, we recommend using a config file. This is a minimal config.yaml you could start with:

botfront:
app:
# The complete external host of the Botfront application (eg. botfront.yoursite.com). It must be set even if running on a private or local DNS (it populates the ROOT_URL).host: botfront.yoursite.commongodb:
enabled: true # disable to use an external mongoDB host# Username of the MongoDB user that will have read-write access to the Botfront database. This is not the root usermongodbUsername: username# Password of the MongoDB user that will have read-write access to the Botfront database. This is not the root usermongodbPassword: password# MongoDB root passwordmongodbRootPassword: rootpassword
helm install botfront -f config.yaml --namespace botfront botfront/botfront --create-namespace

Upgrading:

helm upgrade -f config.yaml botfront --namespace botfront-project botfront botfront/botfront

Rasa

helm install -n my_project --namespace botfront botfront/botfront-project \
--set ingress.host=http://your.public.rasa-host.com

When the chart is installed you will get further instructions to finalize the setup of your project. Here is an example:

NOTES:
The Helm chart was succesfully installed on your cluster.
Please execute the following instructions to complete your project's setup.
1. Your Rasa instance is available at the following URL:
http://rasa.botfront.local
2. Set the following in your Settings > Endpoints:
nlg:
type: 'rasa_addons.core.nlg.GraphQLNaturalLanguageGenerator'
url: 'http://botfront-app-service.botfront/graphql'
action_endpoint:
url: 'http://your.actions.server/webhook' # Change that if you have actions
tracker_store:
store_type: rasa_addons.core.tracker_stores.AnalyticsTrackerStore
# The URL below might be different if you installed Botfront in another namespace.
url: 'http://botfront-webhooks-service.botfront'
project_id: 'bf'
3a. If using Rasa Webchat Open Source, set the following credentials:
rasa_addons.core.channels.webchat.WebchatInput:
session_persistence: true
base_url: http://rasa.botfront.local
3b. If using Rasa Webchat Pro, set the following credentials:
rasa_addons.core.channels.webchat_plus.WebchatPlusInput:
session_persistence: true
base_url: http://rasa.botfront.local
4. Set the Rasa instance internal URL in Settings > Instance:
http://botfront-project-rasa-service.botfront-project

Enterprise customers: you must repeat this step for each Botfront project (change the release name)

To upgrade a Rasa project

helm upgrade -f values-project.yaml my-project --namespace botfront-project botfront/botfront-project

Parameters reference

Botfront

ParameterDescriptionDefault
botfront.versionBotfront API Docker imagev1.0.3
botfront.app.image.nameBotfront Docker imagebotfront/botfront
botfront.app.hostBotfront host (e.g botfront.your-domain.com)nil
botfront.app.graphQLKeyKey to protect the GraphQL APInil
botfront.api.image.nameBotfront API Docker imagebotfront/botfront-api
botfront.ingress.enabledEnable Ingresstrue
botfront.ingress.nginx.enabledEnable if the nginx-ingress controller is installed (and used) on the clustertrue
botfront.ingress.tlsSecretNameOptional. Name of the secret containing the TLS certificate. If not set, SSL will be disablednil
botfront.ingress.tlsHostOptional. Host associated with the TLS certificate (may contain a wildcard)nil
botfront.imagePullSecretName of the secret containing the credentials to pull images from a private Docker reponil

Botfront project (Rasa) parameters

ParameterDescriptionDefault
projectIdProjectIdbf
botfront.graphQLEndpointShould have the form http://<botfront-service>.<botfront-namespace>/graphqlnil
botfront.graphQLKeyBotfront GraphQL API keynil
rasa.imageRasa imagebotfront/rasa-for-botfront:2.2.5-bf.5
rasa.authTokenRasa authentication tokennil
ingress.hostRasa instance hostnil
ingress.tlsSecretNameName of the secret containing the certificatenil
ingress.nginx.enableSessionAffinityenable sticky session see Working with multiple rasa instances for detailstrue
ingress.nginx.enableSocketsenable use of sockets for conversations channels with rasatrue
duckling.urlIf set, the URL will be set as the RASA_DUCKLING_HTTP_URL environment variable to the Rasa deploymentnil

Duckling parameters

ParameterDescriptionDefault
duckling.enabledEnable Duckling in this charttrue
botfront.imageDuckling imagebotfront/duckling:latest

MongoDB parameters

Botfront stores its data in a MongoDB database. A MongoDB deployment (stable/mongodb chart) is included in this chart and can be optionally installed. If you're using Botfront in a production environment, consider adding your own deployment, or using a managed service. And configure automated backups :)

ParameterDescriptionDefault
mongodb.mongodbUsernameThe name of the user accessing the Botfront database (must not be root)bfrw
mongodb.mongodbPasswordThe password of the user accessing the Botfront database (must not be root)nil
mongodb.mongodbHostsAndPortsMongoDB serverbotfront-mongodb-service.botfront:27017
mongodb.mongodbQueryStringMongoDB connection query string&retryWrites=true
mongodb.mongodbRootPasswordMongoDB root password (only required if mongodb.enabled is setnil
mongodb.mongodbOplogUsernameOptional. Considerable database performance gainsnil
mongodb.mongodbOplogPasswordOptional. Considerable database performance gainsnil
mongodb.enabledSet to true to add MongoDB to this deploymentfalse

Important If you are using the provided MongoDB deployment, mongodb.mongodbHost must follow the following pattern: <release-name>-mongodb-service.<namespace>

Mongo Express parameters

Mongo Express is a web-based client for MongoDB. You can optionally add Mongo Express to your deployment

ParameterDescriptionDefault
mongo-express.enabledSet to true to enable a Mongo Express deploymentfalse
mongo-express.basicAuthUsernameThe Basic Auth username to access the Mongo Express interfacenil
mongo-express.basicAuthPasswordThe Basic Auth password to access the Mongo Express interfacenil
mongo-express.mongodbAdminPasswordMongoDB root passwordnil
mongo-express.mongodbServerMongoDB servernil
mongo-express.hosts[0].hostMongo Express hostbotfront-mongodb-service.botfront
mongo-express.hosts[0].paths[0]Mongo Express host path. You must set it to /nil
mongo-express.tls[0].hosts[0]Optional. The host associated to your certificatenil
mongo-express.tls[0].secretNameOptional. Secret containing your certificatenil

Important If you are using the provided MongoDB deployment, mongodb.mongodbHost must follow the following pattern: <release-name>-mongodb-service.<namespace>

Scaling Rasa instances

Two mechanisms can ensure tracker consistency when scaling horizontally:

  • A sticky session ties a conversation to a single Rasa instance. So the load balancer cannot change the Rasa instance dynamically during the conversation.
  • A lock store centralizes the conversation state and makes sure no race condition occurs if the load balancer spreads the conversation across several instances.

Important :

    1. Sockets need to stick with the same instance. The Rasa Webchat requires session affinity Rasa chart enables sticky sessions by default.
    1. Botfront does not provide a model server. Trained models are persisted on persistent volume that is shared across instances. However, if you have more than one instance, you need to rollout restart your Rasa deployment to make sure each instance loads the latest model.

Model server

TO-DO once a model server is setup

Lockstore

Enable and configure redis

Redis is a data structure store, used by rasa as a lockstore it ensure that incoming messages are processed in the right order.

ParameterDescriptionDefault
redis.enabledSet to true to enable redisfalse
redis.usePasswordEnable password authentication for connecting to redistrue
redis.global.passwordThe password value, if not set will be randomly generatednil

Lockstore configuration

Once redis is enabled you will need to update the endpoints in botfront so rasa is able to use it. here is an example of what you should add to the configuration :

lock_store:
type: "redis"url: botfront-redis-master.<your namespace>port: 6379password: <your password>db: 0#

Sticky Session

This is enabled by default. If you are using a lockstore, you will need to disable it or the lockstore serve it purpose. in your rasa values set ingress.nginx.enableSessionAffinity to false`

Pulling from a CGP private registry

Obtain your key.json file:

  1. Create a docker-registry secret in your cluster
kubectl create secret docker-registry gcr-json-key \
--docker-server=https://gcr.io \
--docker-username=_json_key \
--docker-password="$(cat key.json)" \
--namespace botfront
  1. Patch the default service account (or the service account pulling images in your pods) in the namespace Botfront is deployed in.
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "gcr-json-key"}]}' --namespace botfront
  1. Set botfront.imagePullSecret to gcr-json-key

About

Botfront Helm charts

Resources

Stars

12 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages