# ConfigMap for ez-api stack configuration
apiVersion: v1
kind: ConfigMap
metadata:
  name: ez-api-config
  namespace: ez-api-test-dev
  labels:
    app.kubernetes.io/name: ez-api-test-dev
    app.kubernetes.io/component: config
data:
  # PostgreSQL configuration
  POSTGRES_DB: "ezapi"
  LOG_POSTGRES_DB: "ezapi_logs"
  
  # ez-api configuration
  EZ_API_PORT: "8080"
  EZ_CORS_ALLOW_ORIGINS: "*"
  EZ_LOG_RETENTION_DAYS: "30"
  EZ_LOG_MAX_RECORDS: "1000000"
  EZ_LOG_PARTITIONING: "off"
  # 同步可靠性（CP -> Redis outbox）
  EZ_SYNC_OUTBOX_ENABLED: "true"
  EZ_SYNC_OUTBOX_INTERVAL_SECONDS: "5"
  EZ_SYNC_OUTBOX_BATCH_SIZE: "200"
  EZ_SYNC_OUTBOX_MAX_RETRIES: "10"
  # Swagger UI Host (留空则使用相对路径)
  EZ_SWAGGER_HOST: ""
  
  # Balancer configuration
  EZ_BALANCER_PORT: "8081"
  EZ_REDIS_DB: "0"
  EZ_BALANCER_LOG_SINK_ENABLED: "false"
  EZ_BALANCER_LOG_SINK_BASE_URL: "http://ez-api:8080"
  EZ_BALANCER_LOG_SINK_TIMEOUT_SECONDS: "3"
  EZ_BALANCER_STATS_FLUSH_ENABLED: "false"
  EZ_BALANCER_STATS_FLUSH_BASE_URL: "http://ez-api:8080"
  EZ_BALANCER_STATS_FLUSH_INTERVAL_SECONDS: "300"
  EZ_BALANCER_STATS_FLUSH_BATCH_SIZE: "200"
  EZ_BALANCER_STATS_FLUSH_TIMEOUT_SECONDS: "5"
  # 按 provider type 配置非流式请求超时（秒，JSON）
  EZ_BALANCER_TIMEOUT_BY_PROVIDER: '{"default":30,"openai":40,"compatible":40,"anthropic":50,"claude":50,"google":60}'
