apemind-enterprise
by apecloud
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
| Tier | Use case | docs/day | replica | resource budget | Notes |
|---|---|---|---|---|---|
| 1 | Single machine / SOHO / dev | 1-100 | 1+1+1 | values.yaml conservative default requests/limits | docker-compose works equivalently |
| 2 | Mid-size private | 1K-10K | 4 API + 2 worker + 2 parser + 2 frontend | values-production.yaml overlay | recommended for most production |
| 3 | Enterprise / long docs | 10K+ | HPA + leader-election | custom | starts 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:
| Role | Standard backend | Chart values entry point |
|---|---|---|
| Metadata database | PostgreSQL | postgres.* / api.env.DATABASE_URL (escape hatch) |
| Vector database | Qdrant | api.env.VECTOR_DB_TYPE=qdrant + qdrant.* block (URL/PORT/DISTANCE/TIMEOUT_SECONDS + tuning) |
| Graph database | PostgreSQL graph storage | api.env.GRAPH_DB_TYPE=postgresql + graphPostgres.* block (HOST/PORT/DB/CREDENTIALS_SECRET_NAME + pool) |
| Queue/cache/locks | Redis replication + Sentinel | redis.* + Redis URL env overrides |
| Fulltext search | Elasticsearch | elasticsearch.ES_HOST + elasticsearch.* (auth/tuning) |
| Object store | S3-compatible RustFS/MinIO/OSS/S3 | api.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.yamlon top ofvalues.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 themanage_index_templatescluster privilege. - [ ]
OBJECT_STORE_TYPE=s3(notlocal) — multi-replica indexing-worker can't share local disk. - [ ]
INDEXING_QUEUE_BACKEND=redisandINDEXING_QUOTA_BACKEND=redis(notinmemory) —inmemoryis single-process only. (INDEXING_QUOTA_*drives the per-modality LLM cap layer inaperag.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_SECRETis a high-entropy deployment-specific value, preferably supplied throughapi.jwtSecret.existingSecretso values files carry no plaintext key (see JWT Secret). - [ ] Metadata PG
max_connectionsbudget 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.workersuvicorn processes each own a full pool set, so the API term scales withreplicaCount * workers(default workers=1). Shared graph uses the canonicalgraphPostgres.GRAPH_DB_POOL_*knobs, not the role's metadata pool.pgvector.enabled=falsereserves one shared pgvector/fulltext pool per process regardless of the global backend selector: collections can select PostgreSQL fulltext with Qdrant/Milvus vectors.evidence.enabled=trueadds two connections per process. Enabled API HPA usesmax(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. Keeppostgres.maxConnectionsaligned with the live PostgreSQLSHOW max_connections;value before upgrade; the executable path to change the live value is a KubeBlocks Reconfiguring OpsRequest — seedeploy/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 changeindexingWorker.replicaCount, usescripts/k8s/safe-scale-indexing-worker.shor a normal Helm upgrade; do not use rawkubectl scale, which bypasses this guard and can exhaust metadata PostgreSQL connections. Seedocs/ops/pg-pool-sizing.mdfor 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.yamlor 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.yamlsince APEMIND-492, so a node drain or autoscaler eviction can never take down every replica at once). If you enableapi.hpa, keephpa.minReplicas >= api.pdb.minAvailable + 1. - [ ] Observability linkage consistent (render-time guard since APEMIND-492):
metrics.podMonitor.enabled=truerequiresmetrics.serviceMonitor.enabled=true;INDEXING_METRICS_EMITTER=otlprequiresAPEMIND_OBSERVABILITY_MODE=otlp|collectorand a non-emptyOTEL_EXPORTER_OTLP_ENDPOINT— the chart refuses to roll out either silently-blind configuration. Note the Prometheus pull path (worker:9091/metricsscraped by the PodMonitor) works with the defaultINDEXING_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-PGmax_connectionsvs 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/metricslatency, pod restarts, resources and PDB coverage. Pass--api-keyfor the authenticated agent-workspace deep probe,--expected-pg-max-connectionswhen 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.keyselects the key (defaultJWT_SECRET). The api, indexing-worker and parser containers read it throughsecretKeyRef, and the chart-managed.envSecrets 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-jwtPods do not restart when that Secret changes. After rotating the key, run
kubectl rollout restarton the api, indexing-worker and parser Deployments, and bumpapi.env.AGENT_ADMISSION_HMAC_CURRENT_KEY_IDas described next to it invalues.yaml. -
api.env.JWT_SECRET: the key inline in values, rendered into the chart-managed.envSecrets.
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartapemind-enterprise is pinned at v2.13.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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