GCP

Learn how to deploy Flowise on GCP


Prerequisites

  1. Notedown your Google Cloud [ProjectId]

  2. Install Git

  3. Install the Google Cloud CLI

Setup Kubernetes Cluster

  1. Create a Kubernetes Cluster if you don't have one.

Click `Clusters` to create one.
  1. Name the Cluster, choose the right resource location, use Autopilot mode and keep all other default configs.

  2. Once the Cluster is created, Click the 'Connect' menu from the actions menu

  1. Copy the command and paste into your terminal and hit enter to connect your cluster.

  2. Run the below command and select correct context name, which looks like gke_[ProjectId]_[DataCenter]_[ClusterName]

  1. Set the current context

Build and Push the Docker image

Run the following commands to build and push the Docker image to GCP Container Registry.

  1. Clone the Flowise

  1. Build the Flowise

  1. Update the Dockerfile file a little.

Specify the platform of nodejs

Add python3, make and g++ to install

  1. Build as Docker image, make sure the Docker desktop app is running

  1. Push the Docker image to GCP container registry.

Deployment to GCP

  1. Create a yamls root folder in the project.

  2. Add the deployment.yaml file into that folder.

  1. Add the service.yaml file into that folder.

It will be look like below.

  1. Deploy the yaml files by running following commands.

  1. Go to Workloads in the GCP, you can see your pod is running.

  1. Go to Services & Ingress, you can click the Endpoint where the Flowise is hosted.

Congratulations!

You have successfully hosted the Flowise apps on GCP 🥳

Timeout

By default, there is a 30 seconds timeout assigned to the proxy by GCP. This caused issue when the response is taking longer than 30 seconds threshold to return. In order to fix this issue, make the following changes to YAML files:

Note: To set the timeout to be 10 minutes (for example) -- we specify 600 seconds below.

  1. Create a backendconfig.yaml file with the following content:

  1. Issue: kubectl apply -f backendconfig.yaml

  2. Update your service.yaml file with the following reference to the BackendConfig:

  1. Issue: kubectl apply -f service.yaml

Last updated