Build your first agent in just a few minutes with [Rasa Copilot](https://hello.rasa.com/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta).

## 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.

```bash
./azure/rasa/kafka/install-kafka.sh
```

Before continuing to the next step, wait for the `kafka` secret to be created. Run the following command to check for its existence:

```bash
kubectl get secret kafka --namespace $NAMESPACE
```

## 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.

```bash
./azure/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](https://github.com/RasaHQ/rasa-helm-charts/tree/main/charts/rasa), 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 `azure/rasa/assistant/values.template.yaml` that sets all of the key values we need to integrate Rasa with the Azure 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:

```bash
envsubst "$(printf '$%s ' $(env | cut -d= -f1))" < azure/rasa/assistant/values.template.yaml > azure/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:

```bash
helm upgrade --install -n $NAMESPACE rasa azure/rasa/assistant/repos/rasa-helm/rasa -f azure/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:

```bash
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:

```bash
./azure/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!
