Skip to main content

Install Rasa

warning

Before you begin, ensure you've completed all of the previous sections to deploy required infrastructure and to set environment variables that this section requires.

We have now deployed all of the required infrastructure and configured everything required on our cluster. We will now proceed to actually install Rasa Pro using the Rasa Helm Chart. In this section, we will:

  • Install Kafka, which is used by components of Rasa and Studio to communicate.
  • Install Rasa itself using its Helm chart.
  • Deploy a TLS certificate and Kubernetes Ingress to make your assistant available outside of the cluster via HTTPS.

Kafka Installation

We will begin by setting up Kafka, which is used by Rasa Pro and Rasa Studio to communicate with each other, as well as for internal purposes.

You can run the following script to deploy Kafka with an autogenerated random password for authentication. When we setup the assistant in the next step, it will automatically fetch this password and save it in a Kubernetes secret so that other Rasa components can connect to Kafka. You will see some warnings about authentication failures until everything is up and running and it should eventually succeed.

./gcp/rasa/kafka/install-kafka.sh

At the end, you should see here that topics called rasa and rasa-events-dlq have been created. This means that you have now successfully deployed Kafka into the cluster.

Assistant Setup

Now that we've set up Kafka, we can set up the Rasa assistant using the Rasa Helm Chart.

You can run our script to perform the initial setup for the Assistant, and then we'll walk you through the setup that it's most important to understand.

./gcp/rasa/assistant/setup-assistant.sh

Values File

The values.yaml file will contain all of the configuration that gets applied to your assistant by Helm. You can read about all of the available configuration options here, and you can fully customise your setup to meet your organisation's needs and security policies. For simplicity, we've provided a file in the playbook repo gcp/rasa/assistant/values.template.yaml that sets all of the key values we need to integrate Rasa with the GCP infrastructure we've already deployed, leaving placeholder values for things we want to inject as environment variables. You can set these values manually and add any others you require, but we recommend you begin by automatically creating a version with all the environment variables set from the previous sections:

envsubst "$(printf '$%s ' $(env | cut -d= -f1))" < gcp/rasa/assistant/values.template.yaml > gcp/rasa/assistant/values.yaml

If you open this newly created file, you should see that all of your values have been automatically populated from the environment variables we've been setting as we go along.

Deploy Rasa

Now that all the configuration is done, you can deploy Rasa using all of the configuration that you've set:

helm upgrade --install -n $NAMESPACE rasa gcp/rasa/assistant/repos/rasa-helm/rasa --version 1.2.5 -f gcp/rasa/assistant/values.yaml

You can ignore the instructions that will be printed by the above command to use port forwarding to access the deployment.

Check yourself if the Rasa pod has a status of RUNNING by running:

kubectl get pods --namespace $NAMESPACE -l "app.kubernetes.io/name=rasa,app.kubernetes.io/instance=rasa"

Configure Ingress & TLS Certificate

Finally, we can deploy a Kubernetes Ingress and a TLS certificate for the Rasa Pro deployment. This will allow us to interact with the bot from outside the cluster.

We'll create a certificate and deploy an ingress with another script:

./gcp/rasa/ingress/setup-ingress.sh

You will need to wait a few minutes while your certificate is issued and the DNS records propagate. Finally, you will be able to visit your assistant's URL: https://assistant.$DOMAIN. For example, if the value you used for $DOMAIN was example.com, you could visit your assistant on https://assistant.example.com If you receive "Hello from Rasa" response, you have successfully deployed Rasa Pro. If you receive an error, there may just be a delay in issuing the certificate or having the DNS records propagate - wait a few minutes and try again!