apemind-enterprise

by apecloud

Helm chartv2.13.1App 2.13.1Verified publisher

A Helm chart for ApeMind Enterprise on Kubernetes

About this chart

ApeMind Enterprise Helm Chart

This Helm chart deploys ApeMind Enterprise on Kubernetes.

Release artifact scope and version semantics are defined in docs/contracts/chart-release-strategy.md. Production License file delivery and worker-first rotation are documented in LICENSE_DELIVERY.md. Enterprise SSO (OIDC / LDAP / Active Directory) configuration for private deployments is documented in docs/ops/enterprise-sso.md.

Default Configuration

By default, this chart uses images from Docker Container Registry:

  • Backend: docker.io/apecloud/apemind-enterprise:<appVersion>
  • Frontend: docker.io/apecloud/apemind-enterprise-frontend:<appVersion>

The default image tag is pinned to Chart.AppVersion (never latest): released chart artifacts carry the matching release version stamped by the chart release pipeline, so a released chart installs its own release image out of the box. Override with --set image.tag=vX.Y.Z (keep frontend.image.tag matching) to deploy a different version.

For air-gapped / CN deployments that cannot reach Docker Hub, switch every application image (api / indexing-worker / frontend) to a reachable registry with one override:

--set global.imageRegistry=apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com

Installation

# Install the chart (Tier 1 — single machine / SOHO / 1-100 docs/day)
helm install apemind ./deploy/apemind

# Tier 2 — mid-size private deployment (1K-10K docs)
helm install apemind ./deploy/apemind \
  -f deploy/apemind/values.yaml \
  -f deploy/apemind/values-production.yaml

# Or with a custom version / mirror registry
helm install apemind ./deploy/apemind \
  --set global.imageRegistry=apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com \
  --set image.tag=v2.3.67 \
  --set frontend.image.tag=v2.3.67

Tier Matrix

TierUse casedocs/dayreplicaresource budgetNotes
1Single machine / SOHO / dev1-1001+1+1values.yaml conservative default requests/limitsdocker-compose works equivalently
2Mid-size private1K-10K4 API + 2 worker + 2 parser + 2 frontendvalues-production.yaml overlayrecommended for most production
3Enterprise / long docs10K+HPA + leader-electioncustomstarts from Tier 2 + adds HPA (KEDA queue depth) + reconciler/cleanup leader-election (#104) + dedicated vector cluster + pgbouncer (#103)

Standard Private Backend Profile

For private deployments that should be reliable with minimal operational complexity, use values-production.yaml together with the database clusters created by deploy/databases/. The standard shape is intentionally small:

RoleStandard backendChart values entry point
Metadata databasePostgreSQLpostgres.* / api.env.DATABASE_URL (escape hatch)
Vector databaseQdrantapi.env.VECTOR_DB_TYPE=qdrant + qdrant.* block (URL/PORT/DISTANCE/TIMEOUT_SECONDS + tuning)
Graph databasePostgreSQL graph storageapi.env.GRAPH_DB_TYPE=postgresql + graphPostgres.* block (HOST/PORT/DB/CREDENTIALS_SECRET_NAME + pool)
Queue/cache/locksRedis replication + Sentinelredis.* + Redis URL env overrides
Fulltext searchElasticsearchelasticsearch.ES_HOST + elasticsearch.* (auth/tuning)
Object storeS3-compatible RustFS/MinIO/OSS/S3api.env.OBJECT_STORE_TYPE=s3 + historical minio.* block

The overlay does not store secret-bearing Redis URLs or object-store keys. Environment-specific values should provide credentials through Kubernetes Secrets, sealed values, or an operator-maintained override file.

Elasticsearch index-template privilege

Every standard delivery must satisfy one of these conditions: Elasticsearch runs with xpack.security.enabled=false, or the account used by ApeMind has the manage_index_templates cluster privilege. The application image does not grant this privilege, and the Helm chart only injects connection credentials; it does not create Elasticsearch roles or grant cluster privileges.

The canonical fulltext index template is installed lazily on the first fulltext task, not during image or pod startup. If the privilege is missing, indexing continues under the warn policy, but if the index is externally deleted, Elasticsearch can auto-create it with a noncanonical mapping. Grant and verify the privilege in Elasticsearch before deploying whenever security is enabled.

This profile keeps the operational footprint small: prefer fewer moving parts, use backends with simple recovery paths, and keep Neo4j/Nebula/Milvus as opt-in extensions rather than the default shape.

Production Checklist (Tier 2+)

  • [ ] Apply deploy/apemind/values-production.yaml on top of values.yaml.
  • [ ] Install the companion database clusters from deploy/databases/ before installing the application chart.
  • [ ] Elasticsearch has xpack.security.enabled=false, or the ApeMind account has the manage_index_templates cluster privilege.
  • [ ] OBJECT_STORE_TYPE=s3 (not local) — multi-replica indexing-worker can't share local disk.
  • [ ] INDEXING_QUEUE_BACKEND=redis and INDEXING_QUOTA_BACKEND=redis (not inmemory) — inmemory is single-process only. (INDEXING_QUOTA_* drives the per-modality LLM cap layer in aperag.indexing.llm_quota; the legacy tenant token-bucket layer was deleted by the indexing-refactor RFC §4 hard-cut, env names retained.)
  • [ ] Redis queue/quota/memory/cache URLs are either derived from redis.* or explicitly supplied with credentials from Secrets.
  • [ ] JWT_SECRET is a high-entropy deployment-specific value, preferably supplied through api.jwtSecret.existingSecret so values files carry no plaintext key (see JWT Secret).
  • [ ] Metadata PG max_connections budget verified by Helm render-time guard: api replicas * api.workers * (async pool + sync pool + SSE pool + shared graph pool + shared pgvector/fulltext pool + Evidence pool) + worker replicas * (async pool + sync pool + shared graph pool + shared pgvector/fulltext pool + Evidence pool) + surge + reserved <= postgres.maxConnections. api.workers uvicorn processes each own a full pool set, so the API term scales with replicaCount * workers (default workers=1). Shared graph uses the canonical graphPostgres.GRAPH_DB_POOL_* knobs, not the role's metadata pool. pgvector.enabled=false reserves one shared pgvector/fulltext pool per process regardless of the global backend selector: collections can select PostgreSQL fulltext with Qdrant/Milvus vectors. evidence.enabled=true adds two connections per process. Enabled API HPA uses max(replicaCount, hpa.maxReplicas) for metadata and graph budgets. Unbounded pools cannot pass the guard. The base Chart uses a 5+10 pgvector/fulltext pool, totaling 195 metadata connections (199 with Evidence); the Tier 2 production overlay (4 API pods × 2 uvicorn workers, benchmarked in APEMIND-451) totals 1030. Existing explicit pool overrides are preserved and may require resizing. Keep postgres.maxConnections aligned with the live PostgreSQL SHOW max_connections; value before upgrade; the executable path to change the live value is a KubeBlocks Reconfiguring OpsRequest — see deploy/databases/README.md "PostgreSQL max_connections alignment".
  • [ ] Dedicated graph PG budget verified independently: (api replicas * api.workers + enabled worker replicas) * (GRAPH_DB_POOL_SIZE + GRAPH_DB_POOL_MAX_OVERFLOW) + graph surge + graph reserved <= graphPostgres.maxConnections. The database installer validates profile parity, applies the graph cluster value, restarts the whole PostgreSQL component, and verifies every replica. To change indexingWorker.replicaCount, use scripts/k8s/safe-scale-indexing-worker.sh or a normal Helm upgrade; do not use raw kubectl scale, which bypasses this guard and can exhaust metadata PostgreSQL connections. See docs/ops/pg-pool-sizing.md for Tier 1 dedicated-graph and Tier 2 shared-graph sizing examples.
  • [ ] Resource requests/limits reviewed for your workload (defaults prevent BestEffort QoS; Tier 2+ should use values-production.yaml or custom values).
  • [ ] PVC sized for the expected document volume and each stateful backend has an accepted backup/recovery path.
  • [ ] PodDisruptionBudgets active for api / indexingWorker / frontend (default-on in values-production.yaml since APEMIND-492, so a node drain or autoscaler eviction can never take down every replica at once). If you enable api.hpa, keep hpa.minReplicas >= api.pdb.minAvailable + 1.
  • [ ] Observability linkage consistent (render-time guard since APEMIND-492): metrics.podMonitor.enabled=true requires metrics.serviceMonitor.enabled=true; INDEXING_METRICS_EMITTER=otlp requires APEMIND_OBSERVABILITY_MODE=otlp|collector and a non-empty OTEL_EXPORTER_OTLP_ENDPOINT — the chart refuses to roll out either silently-blind configuration. Note the Prometheus pull path (worker :9091/metrics scraped by the PodMonitor) works with the default INDEXING_METRICS_EMITTER=noop; the emitter only governs the OTLP push pipeline.
  • [ ] Post-install health audit green: run bash deploy/scripts/preflight-audit.sh -n <namespace> after install or upgrade (read-only; exits non-zero on FAIL). It checks PG/Graph-PG max_connections vs the Helm contract, connection usage, pg_stat_statements/pg_trgm, Redis memory+eviction+clients, ES health + IK plugin, agent-workspace isolation wiring, object-store reachability, API /api/v2/metrics latency, pod restarts, resources and PDB coverage. Pass --api-key for the authenticated agent-workspace deep probe, --expected-pg-max-connections when the deployment deviates from the Tier 2 default.

For PG connection-pool sizing detail see pg-pool-sizing.md.

Environment Variables

All environment variables are managed through the release-scoped <fullname>-env Secret. See apemind-secret.yaml template for configuration options.

JWT Secret

Supply the JWT signing key through exactly one of two values; the render fails when both or neither are set.

  • api.jwtSecret.existingSecret (recommended): the name of a pre-created Secret; api.jwtSecret.key selects the key (default JWT_SECRET). The api, indexing-worker and parser containers read it through secretKeyRef, and the chart-managed .env Secrets do not carry it.

    kubectl -n <namespace> create secret generic apemind-jwt \
      --from-literal=JWT_SECRET="$(openssl rand -hex 32)"
    helm upgrade -i apemind ./deploy/apemind \
      --set api.jwtSecret.existingSecret=apemind-jwt
    

    Pods do not restart when that Secret changes. After rotating the key, run kubectl rollout restart on the api, indexing-worker and parser Deployments, and bump api.env.AGENT_ADMISSION_HMAC_CURRENT_KEY_ID as described next to it in values.yaml.

  • api.env.JWT_SECRET: the key inline in values, rendered into the chart-managed .env Secrets.

To switch an existing release to existingSecret, create the Secret with the current value so issued tokens stay valid, then set api.jwtSecret.existingSecret and clear api.env.JWT_SECRET in the same upgrade.

ApeMind Parser service

parser.enabled=true (default) deploys the standalone ApeMind Parser (python -m aperag.parser_service, dedicated apemind-parser image) as a <fullname>-parser Deployment + ClusterIP Service on parser.port (default 8090). The indexing worker posts PDF pages to it and chat attachments are parsed through it; the backend images no longer ship parser dependencies, so parser.enabled=false disables local parsing entirely rather than falling back to in-process parsing — only configured remote parsers remain. parser.workerCount pins page-worker processes per pod (empty = one per cgroup CPU). parser.authToken can point both sides at a shared bearer-token Secret; leave empty for unauthenticated cluster-internal calls. parser.terminationGracePeriodSeconds must stay above the service drain window (APEMIND_PARSER_GRACE_SECONDS, default 360s).

Ingress Paths

Ingress path routing is driven by ingress.rules. The default values preserve the standard paths and point at release-scoped Service names:

  • /api -> <fullname>-api:8000
  • /mcp -> <fullname>-api:8000
  • / -> <fullname>-frontend:3000

Override ingress.rules to add or replace paths without editing the chart template. Set ingress.enabled=false to suppress Ingress rendering. A rule can set host; otherwise it falls back to ingress.host when non-empty. Leave service.api.name / service.frontend.name empty for release-scoped names so multiple releases can coexist in one namespace; set them only when a deployment needs stable historical DNS aliases.

Local Data Volume

API and indexing-worker pods share the data volume mounted at /data. The default api.dataVolume.type=hostPath preserves existing single-node behavior. For durable local object storage or cache persistence, set api.dataVolume.type=persistentVolumeClaim and either provide api.dataVolume.persistentVolumeClaim.existingClaim or let the chart render a PVC. Do not use emptyDir with api.env.OBJECT_STORE_TYPE=local; the chart fails rendering because uploaded objects would disappear on pod restart.

Graph Backend Values

The default graph backend is PostgreSQL (`api.env.GRAPH_DB_TYPE=p

Deploy apemind-enterprise with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has apemind-enterprise on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartapemind-enterprise is pinned at v2.13.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply