Skip to main content

Kubernetes Deployment with Helm

Deploy Cognee on Kubernetes using the chart in deployment/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.
Cognee runs as a single-replica deployment. The API pod is a single process with process-local locks and caches, so running multiple replicas against the same stores is not supported — do not enable horizontal autoscaling or set replicaCount above 1. The chart prints a warning after install when replicaCount > 1. Scale vertically (more CPU/memory per pod) instead.

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 cluster

GitOps 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:
The chart ships a values.schema.json with additionalProperties: false, so unknown keys fail the install before anything reaches the cluster. Keys such as cognee.image, cognee.replicas, cognee.env.OPENAI_API_KEY, postgresql, neo4j, qdrant, monitoring, and networkPolicy are not part of this chart and will be rejected with a values don't meet the specifications of the schema error. The schema also constrains image.pullPolicy to Always/Never/IfNotPresent, service.type to ClusterIP/NodePort/LoadBalancer, and ports to 1–65535.
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

Cognee Services
  • Cognee API: single-replica Deployment running image.repository:image.tag
  • Service: ClusterIP on service.port (8000) by default
  • ServiceAccount: created by default with automountServiceAccountToken: false

Database Configuration

The ConfigMap pins DB_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.

Production Configuration

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).
Defaults are set for both containers; raise them for production workloads:
The container security context defaults to allowPrivilegeEscalation: false with all Linux capabilities dropped, and the chart’s ServiceAccount does not mount an API token. Add pod-level settings as needed:
Set serviceAccount.create: false and serviceAccount.name to reuse an existing account (for example one bound to a cloud IAM role).
Increase startupProbe.failureThreshold if first boot (image pull plus database initialization) regularly takes longer than five minutes.

Health & Probes

The chart wires GET /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.
livenessProbe is disabled by default and should stay that way with the current endpoint. /health verifies external dependencies — database, vector store, graph store, filesystem — so wiring it to liveness makes Kubernetes restart the pod during transient dependency outages, producing CrashLoopBackOff instead of letting the pod recover. Enable liveness only against a process-only endpoint that reports whether the process itself is alive.
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

Schema violations surface here rather than mid-rollout.

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 when replicaCount > 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

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.

Troubleshooting

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

Uninstalling will permanently delete all data unless you have backups. Ensure you have proper backup procedures in place.

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.