Helm

使用 Helm 在 Kubernetes 上部署 Activepieces

本指南将引导你使用官方 Helm chart 在 Kubernetes 上部署 Activepieces。

前置条件

  • Kubernetes 集群(v1.19+)
  • 已安装 Helm 3.x
  • 配置了访问集群的 kubectl

使用外部 PostgreSQL 和 Redis

Helm chart 支持使用外部 PostgreSQL 和 Redis 服务,而不是部署 Bitnami 子 chart。

使用外部 PostgreSQL

要使用外部 PostgreSQL 实例:

postgresql:
  enabled: false  # 禁用 Bitnami PostgreSQL 子 chart
  host: "your-postgres-host.example.com"
  port: 5432
  useSSL: true  # 如果需要,启用 SSL
  auth:
    database: "activepieces"
    username: "postgres"
    password: "your-password"
    # 或者使用外部密钥引用:
    # externalSecret:
    #   name: "postgresql-credentials"
    #   key: "password"

或者,你也可以使用连接 URL:

postgresql:
  enabled: false
  url: "postgresql://user:password@host:5432/database?sslmode=require"

使用外部 Redis

要使用外部 Redis 实例:

redis:
  enabled: false  # 禁用 Bitnami Redis 子 chart
  host: "your-redis-host.example.com"
  port: 6379
  useSSL: false  # 如果需要,启用 SSL
  auth:
    enabled: true
    password: "your-password"
    # 或者使用外部密钥引用:
    # externalSecret:
    #   name: "redis-credentials"
    #   key: "password"

或者,你也可以使用连接 URL:

redis:
  enabled: false
  url: "redis://:password@host:6379/0"

外部密钥引用

为了更好的安全性,你可以引用现有的 Kubernetes Secret 中的密码(可与 External Secrets Operator 或 Sealed Secrets 配合使用):

postgresql:
  enabled: false
  host: "your-postgres-host.example.com"
  auth:
    externalSecret:
      name: "postgresql-credentials"
      key: "password"

redis:
  enabled: false
  host: "your-redis-host.example.com"
  auth:
    enabled: true
    externalSecret:
      name: "redis-credentials"
      key: "password"

快速开始

1. 克隆仓库

git clone https://github.com/activepieces/activepieces.git
cd activepieces

2. 安装依赖

helm dependency update

3. 创建 Values 文件

创建一个 my-values.yaml 文件并写入你的配置。你可以参考示例 values 文件。 Helm chart 为必需值提供了合理的默认值,并将可选值留空,但你仍应为生产环境自定义这些核心值。

4. 安装 Activepieces

helm install activepieces deploy/activepieces-helm -f my-values.yaml

5. 验证安装

# 检查部署状态
kubectl get pods
kubectl get services

生产环境清单

  • frontendUrl 设置为你的实际域名
  • 为 PostgreSQL 和 Redis 设置强密码(或保留自动生成的密码)
  • 配置带 TLS 的适当 Ingress
  • 设置适当的资源限制
  • 配置持久化存储
  • 根据安全需求选择合适的执行模式
  • 查看环境变量以了解高级配置
  • 考虑使用独立工作节点配置以提高可用性和安全性

升级

# 更新依赖
helm dependency update

# 升级版本
helm upgrade activepieces deploy/activepieces-helm -f my-values.yaml

# 检查升级状态
kubectl rollout status deployment/activepieces

故障排查

常见问题

  1. Pod 无法启动:使用 kubectl logs deployment/activepieces 查看日志
  2. 数据库连接:验证 PostgreSQL 凭据和连接是否正常
  3. 前端 URL:确保 frontendUrl 可从外部访问
  4. Webhook 不工作:检查 Ingress 配置和 DNS 解析

常用命令

# 查看日志
kubectl logs deployment/activepieces -f

# 端口转发用于测试
kubectl port-forward svc/activepieces 4200:80 --namespace default

# 获取所有资源
kubectl get all --namespace default

版本

Activepieces 支持三个版本:

  • ce(社区版):包含所有核心功能的开源版本(默认)
  • ee(企业版):自托管版本,包含 SSO、RBAC 和审计日志等高级功能
  • cloud:用于 Activepieces Cloud 部署

在 values 文件中设置版本:

activepieces:
  edition: "ce"  # 或使用 "ee" 表示企业版

关于企业版功能和许可,请访问 activepieces.com

环境变量

关于配置选项的完整列表,请参阅环境变量文档。大多数环境变量可以通过 Helm values 文件中的 activepieces 部分进行配置。

执行模式

了解执行模式对于安全性和性能至关重要。请参阅沙箱指南,为你的部署选择合适的模式。

卸载

helm uninstall activepieces

# 清理持久化卷(可选)
kubectl delete pvc -l app.kubernetes.io/instance=activepieces