Evose
私有化

私有化 · Kubernetes 部署

K8s + Helm 部署 · 资源规划 · 横向扩展

生产推荐部署。Helm Chart 封装,声明式管理。

前置

要求
K8s1.24+
Helm3.x
Ingress Controllernginx-ingress / Traefik
Cert Manager自动证书(可选)
StorageClass支持 RWO / RWX(取决于场景)

拓扑

                           ┌──→ evose-api (3+ replicas)
[Ingress] → [Web]  ────────┼──→ ...
                           └──→ evose-worker (2+ replicas, 队列消费)

           [MySQL] ←─────── 主从复制
           [PostgreSQL] ←── 主从复制
           [Redis] ←─────── 集群 / 哨兵
           [对象存储] ←──── S3 / OSS / MinIO

部署

1 · 加 Helm 仓库

helm repo add evose <repo-url>
helm repo update

2 · 准备 values.yaml

最小:

global:
  domain: evose.example.com
  storageClass: standard
 
ingress:
  enabled: true
  className: nginx
  tls:
    enabled: true
    secretName: evose-tls
 
mysql:
  replicaCount: 1                # 生产建议 3
  persistence:
    size: 100Gi
 
postgres:
  replicaCount: 1
  persistence:
    size: 200Gi
  config:
    shared_buffers: 8GB
 
redis:
  architecture: replication
  replicaCount: 3
 
evose:
  api:
    replicaCount: 3
    resources:
      requests:
        cpu: 1
        memory: 2Gi
      limits:
        cpu: 4
        memory: 8Gi
 
  worker:
    replicaCount: 2
 
secrets:
  secretKey: <openssl rand -hex 32>
  adminEmail: admin@example.com
  adminPassword: <强密码>
 
llm:
  provider: openai
  apiKey: <key>
  baseUrl: https://api.openai.com/v1

3 · 安装

# 创建命名空间
kubectl create ns evose
 
# 安装 Cert Manager(可选,用 Let's Encrypt)
# ...
 
# 部署 Evose
helm install evose evose/evose -n evose -f values.yaml
 
# 等待就绪
kubectl -n evose get pods -w

4 · 验证

# 看 Ingress
kubectl -n evose get ingress
 
# 看健康
curl https://evose.example.com/health

横向扩展

# 业务 API 实例
kubectl -n evose scale deploy evose-api --replicas=5
 
# Worker 队列消费
kubectl -n evose scale deploy evose-worker --replicas=4

或 HPA(自动伸缩):

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: evose-api
spec:
  scaleTargetRef:
    kind: Deployment
    name: evose-api
  minReplicas: 3
  maxReplicas: 20
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70

资源规划

组件requestslimits备注
evose-api1 cpu / 2Gi4 cpu / 8Gi用户负载
evose-worker1 cpu / 2Gi4 cpu / 8Gi异步任务
mysql4 cpu / 16Gi8 cpu / 32Gi业务核心
postgres4 cpu / 16Gi8 cpu / 32Gi知识库向量
redis1 cpu / 2Gi2 cpu / 4Gi缓存 / 队列

备份(K8s 场景)

对象工具
MySQL / PostgreSQLVelero + 定期 snapshot / 逻辑备份 CronJob
文件对象存储自带版本 / 跨区域复制
K8s 资源Velero

升级

helm upgrade evose evose/evose -n evose -f values.yaml

升级详细流程

接下来

  • 高可用拓扑 → HA
  • 升级 → 升级

页面导航