GCP

Learn how to deploy Flowise on GCP

Prerrequisitos

  1. Instala kubectl

Configuración de GCP

  1. Crea un nuevo proyecto en GCP

  2. Habilita las siguientes APIs:

    • Kubernetes Engine API

    • Container Registry API

  3. Crea un cluster de Kubernetes en GKE

  4. Configura kubectl para usar el cluster de GKE:

gcloud container clusters get-credentials [ClusterName] --zone [DataCenter] --project [ProjectId]
  1. Verifica que kubectl esté usando el contexto correcto:

kubectl config use-context gke_[ProjectId]_[DataCenter]_[ClusterName]

Build y Push de la Imagen Docker

Ejecuta los siguientes comandos para hacer build y push de la imagen Docker al Container Registry de GCP.

  1. Clona Flowise

  1. Haz build de Flowise

  1. Actualiza el archivo Dockerfile un poco.

Especifica la plataforma de nodejs

Agrega python3, make y g++ a la instalación

  1. Haz build como imagen Docker, asegúrate de que la app de Docker desktop esté corriendo

  1. Haz push de la imagen Docker al container registry de GCP.

Deployment en GCP

  1. Crea una carpeta raíz yamls en el proyecto.

  2. Agrega el archivo deployment.yaml en esa carpeta.

  1. Agrega el archivo service.yaml en esa carpeta.

Se verá como abajo.

  1. Haz deploy de los archivos yaml ejecutando los siguientes comandos.

  1. Ve a Workloads en GCP, podrás ver que tu pod está corriendo.

  1. Ve a Services & Ingress, podrás hacer clic en Endpoint donde se hospeda Flowise.

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