Configuring Rasa X postgresql as external instance

I am trying to convert the default postgresql instance that comes with Rasa X to an external one I have set up, so that I can store conversations there.

I deployed my Rasa X with the Helm Chart Installation method.

I read from the docs that I have to do the following:

postgresql: install: false existingHost: “” existingSecretKey: “”

global: postgresql: existingSecret: “” servicePort: postgresqlDatabase: “” postgresqlUsername: “”

I understand what to do from the docs, except I am not sure what to put as existingSecret and existingSecretKey.

I will appreciate any help as this is very urgent!

Best regards,

Chidi Akurunwa.

Here is how I solved it for myself.

Firstly, I added these lines to values.yml (make sure to replace my.postgres.host with your actual host name):

...

postgresql:
    install: false
    existingHost: "my.postgres.host"
    existingSecretKey: "postgresql-password"
...

global:
    postgresql:
        existingSecret: "my-postgresql-secret"
...

NOTE: The phrase postgresql-password here is just an arbitrary name that I chose for my secret key (do not replace it with the actual password - you will be specifying the actual password later).

After that I created my-postgresql-secret secret using the following command (make sure to replace YOUR-NAMESPACE with the actual namespace you’re deploying in):

kubectl --namespace YOUR-NAMESPACE create secret generic my-postgresql-secret

Then I opened the secret in order to edit its content:

kubectl --namespace YOUR-NAMESPACE edit secret my-postgresql-secret

This command opened vim editor for me and presented me with content similar to the following:

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: Secret
metadata:
  creationTimestamp: "2021-10-22T19:35:39Z"
  name: my-postgresql-secret
  namespace: YOUR-NAMESPACE
  resourceVersion: "1371123"
  uid: 1a342634-12ba-47eb-a4ac-dbc535e87f10
type: Opaque

I appended stringData: postgresql-password: ... to the end (and saved my changes using :wq in vim):

  ...
type: Opaque
stringData:
  postgresql-password: your-actual-postgresql-password

After that I installed Rasa X helm chart.

P. S. You can find more info on how to manage secrets in Kubernetes here: Managing Secrets using Configuration File | Kubernetes