Kubernetes Deployment with Helm
Deploy Cognee on Kubernetes using the chart indeployment/helm for enterprise-grade deployments with full control over configuration and resources.
Kubernetes deployment provides container orchestration, auto-healing, and declarative configuration for production workloads.
The chart deploys the Cognee API together with a bundled PostgreSQL + pgvector database. Relational metadata and vectors both live in that Postgres instance — the chart does not bundle Neo4j or Qdrant.
The chart does not deploy the Cognee web UI or the MCP server. Both are published as separate images (cognee/cognee-ui and cognee/cognee-mcp) that you run alongside the chart. Point the UI at the API with COGNEE_BACKEND_URL, set to an address the browser can reach: the browser calls the API directly, and the chart’s default ClusterIP Service resolves only inside the cluster (see Cognee + Web UI). Run the MCP server in API mode with API_URL set to the API’s address, such as the chart’s Service URL when the MCP server runs in the same cluster.
Why Kubernetes + Helm?
Enterprise Ready
Resource requests/limits, a restricted security context, and a dedicated ServiceAccount ship as defaults
Auto-Healing
Startup and readiness probes keep traffic away from a pod until its dependencies are reachable
Validated Values
values.schema.json validates your values before anything is applied to the clusterGitOps Integration
Version-controlled infrastructure with automated deployment pipelines
Prerequisites
1
Kubernetes Cluster
You need a running Kubernetes cluster:
- Local: Minikube, Kind, or Docker Desktop
- Cloud: GKE, EKS, AKS, or DigitalOcean Kubernetes
- On-premise: Self-managed Kubernetes cluster
The chart targets Kubernetes 1.25+ and Helm 3.10+.
2
Install Tools
3
Configure Access
Quick Deployment
1
Clone Repository
2
Create the credentials Secret
Credentials are kept out of
values.yaml. Create a Secret holding LLM_API_KEY and DB_PASSWORD, and point the chart at it with existingSecret:If you skip this step, the chart renders its own Secret from
postgres.auth.password with an empty LLM_API_KEY. That is a development convenience only — the post-install notes print the kubectl patch command to fill the key in.3
Configure Values
Create a
values.yaml file to customize your deployment. Only keys that exist in the chart are accepted:4
Deploy with Helm
5
Verify Deployment
Resource names are
<release>-<chart> unless you set nameOverride / fullnameOverride, so a release named cognee produces cognee-cognee-chart and cognee-cognee-chart-postgres.Values Reference
If you change
service.port, set startupProbe.httpGet.port and readinessProbe.httpGet.port to match — the probe ports are separate values and default to 8000.Architecture Components
- Application Tier
- Data Tier
- Infrastructure
Cognee Services
- Cognee API: single-replica Deployment running
image.repository:image.tag - Service:
ClusterIPonservice.port(8000) by default - ServiceAccount: created by default with
automountServiceAccountToken: false
Database Configuration
The ConfigMap pinsDB_PROVIDER: postgres explicitly, so the API always talks to the bundled Postgres service rather than silently falling back to SQLite. DB_HOST is derived from the chart’s Postgres service name, and DB_PORT, DB_NAME, and DB_USERNAME follow postgres.port and postgres.auth.*. DB_PASSWORD comes only from the Secret.
VECTOR_DB_PROVIDER defaults to pgvector, which is why the bundled image is pgvector/pgvector:pg17 — embeddings are stored in the same database.
To run against an external database instead of the bundled one, override the environment through your own ConfigMap/Secret layer or a chart fork; the shipped chart always deploys and points at its own Postgres.
Data Persistence
Only the Postgres pod gets a PersistentVolumeClaim. The Cognee API pod mounts no volume, so anything it writes to its local filesystem is lost when the pod is recreated (for example by a restart, rollout, or reschedule):
The
cognee/cognee image sets SYSTEM_ROOT_DIRECTORY=/cognee-storage/system and DATA_ROOT_DIRECTORY=/cognee-storage/data. The chart’s values schema has no keys for extra volumes or environment variables, so keeping the graph needs a chart fork that does one of the following:
-
Store the graph in the bundled Postgres by adding
GRAPH_DATABASE_PROVIDER: "postgres_demo"to the ConfigMap. With the chart’s defaultcognee.enableBackendAccessControl: falseand noGRAPH_DATABASE_*connection settings, Cognee reuses theDB_*settings, so the graph lands on the Postgres PVC with no other changes. With access control on, it requires explicitGRAPH_DATABASE_HOST,_PORT,_USERNAME, and_PASSWORD. This adapter is a demo — see Choosing a production graph store before relying on it in production. Ingested files still live under/cognee-storage/data, so mount a volume there too if you need to keep them. -
Mount a PVC at
/cognee-storageintemplates/cognee_deployment.yaml. The image runs as uid/gid 1000, so setpodSecurityContext.fsGroup: 1000in your values (it is a chart value, no fork needed) to make the volume writable. The chart’s Deployment uses the defaultRollingUpdatestrategy, which briefly runs the old and new pod together; setstrategy.type: Recreatein the fork so two pods never open the same volume: -
Use an external graph database by adding
GRAPH_DATABASE_PROVIDERand its connection settings to the ConfigMap, withGRAPH_DATABASE_PASSWORDkept in the Secret and wired into the container’senvthe wayDB_PASSWORDis — see Graph Stores. Ingested files still live under/cognee-storage/data, so mount a volume there too if you need to keep them.
Production Configuration
Credentials with existingSecret
Credentials with existingSecret
Create the Secret outside Helm (kubectl, External Secrets, Vault, …), then reference it:Both the Cognee Deployment and the Postgres Deployment read their credentials from this Secret, so the database password and the API’s
DB_PASSWORD cannot drift apart. Helm never renders this Secret, so the checksum annotations do not notice updates to it — after rotating it, restart the pods explicitly (see Rotating credentials below).Resources
Resources
Defaults are set for both containers; raise them for production workloads:
Security Context & ServiceAccount
Security Context & ServiceAccount
The container security context defaults to Set
allowPrivilegeEscalation: false with all Linux capabilities dropped, and the chart’s ServiceAccount does not mount an API token. Add pod-level settings as needed:serviceAccount.create: false and serviceAccount.name to reuse an existing account (for example one bound to a cloud IAM role).Probe tuning
Probe tuning
startupProbe.failureThreshold if first boot (image pull plus database initialization) regularly takes longer than five minutes.Health & Probes
The chart wiresGET /health to a startup probe and a readiness probe. The startup probe allows up to 30 attempts, 10 seconds apart, before the pod is failed; the readiness probe then polls every 10 seconds after a 10 second delay and pulls the pod out of the Service whenever its dependencies are unhealthy.
Postgres uses pg_isready for its startup, readiness, and liveness probes, so the API’s readiness naturally follows the database coming up.
Upgrading from an Earlier Chart
1
Move credentials into a Secret
Inline API keys in
values.yaml are no longer part of the values surface. Create a Secret with LLM_API_KEY and DB_PASSWORD and set existingSecret.2
Rename your values keys
The values structure is flat:
image.*, service.*, replicaCount, resources.requests/limits, and postgres.auth.*. Older layouts such as cognee.image, cognee.port, cognee.env.<VAR>, and cognee.resources.cpu are rejected by the schema.3
Review database behavior
DB_PROVIDER is now pinned to postgres in the ConfigMap. Deployments that previously ran on the implicit SQLite fallback will start against Postgres and see an empty knowledge base.4
Dry-run before applying
Scaling & Performance
Cognee scales vertically: give the single API pod more CPU and memory rather than adding replicas. Horizontal Pod Autoscaling is not supported — multiple Cognee pods writing to the same stores is not a supported configuration, and the chart warns after install whenreplicaCount > 1.
1
Vertical Pod Autoscaler
2
Scale the database, not the app
Give the bundled Postgres more CPU, memory, and PVC space through
postgres.resources and postgres.storage, or run a managed Postgres alongside a chart fork.Maintenance Operations
Updates & Rollbacks
Updates & Rollbacks
Rotating credentials
Rotating credentials
Changing
DB_PASSWORD after Postgres has been initialized does not change the password already stored in the database volume — rotate it inside Postgres as well, or reinitialize the volume.Health Monitoring
Health Monitoring
Troubleshooting
- Values Rejected
- Pod Not Ready
- LLM Calls Failing
- Database Issues
values don't meet the specifications of the schemaThe chart validates values against values.schema.json before rendering. The message names the offending path — most often an unknown top-level key or a key from an older values layout.Uninstalling
1
Remove Helm Release
2
Clean Up Resources
Next Steps
Monitoring Setup
Observability StackThe chart does not ship ServiceMonitor or dashboard resources — wire Prometheus and Grafana in through your own manifests.
CI/CD Integration
GitOps DeploymentSet up automated deployments with ArgoCD or Flux.
Need Help?
Join our community for Kubernetes deployment support and production best practices.