Deploy with Kubernetes¶
The Helm chart in deploy/k8s deploys:
extralitserver: web UI and API on port 6900extralit-worker: RQ workers for background jobs. Every worker pod pulls from the same Redis queues, so raisingworker.replicaCountspreads jobs across pods- PostgreSQL: main database (in-chart StatefulSet, or external)
- Redis: job queue, persisted with AOF (in-chart Deployment, or external)
- Elasticsearch: search engine for records (managed by the ECK operator, or external)
Uploaded files and LanceDB indexes live under EXTRALIT_HOME_PATH on a PersistentVolumeClaim shared by the server and worker, unless you point storage.url at S3-compatible storage.
Prerequisites¶
- Kubernetes 1.23+ with a default StorageClass
- kubectl and Helm 3.8+
- The ECK operator, unless you use an external Elasticsearch
For a local cluster, kind or minikube both work; give it at least 4 GB of memory.
Install¶
-
Install the ECK operator:
-
Clone the repository and install the chart:
git clone https://github.com/extralit/extralit.git cd extralit helm install extralit deploy/k8s -n extralit --create-namespaceThe owner password, API key and PostgreSQL password are generated unless you set
extralit.auth.password,extralit.auth.apiKeyandpostgresql.auth.password. Set all three when rendering without cluster access (helm template, Argo CD, Flux): the chart can't read back the previous values there, so it would generate new ones on every sync and the server would lose access to PostgreSQL. -
Wait for the pods to become ready. The server pod runs database migrations and creates the owner user on startup, so it takes a minute or two:
-
Open Extralit:
Then go to http://localhost:6900 and log in as
extralit. Get the password with: -
Optionally, check the release with the bundled Helm test:
Limitations¶
- Text extraction jobs fail. The
ocrqueue's text-extraction job importsextralit_ocr, which is installed in the HF Space image but not inextralit-server. Layout extraction and the otherocrjobs run. - Redis is a single pod. It keeps queued jobs across restarts but has no failover; use
externalRediswith a managed Redis for high availability. - Workers share one node by default. With a
ReadWriteOncevolume and file storage, every worker runs on the server's node. To spread workers across nodes, use S3 storage (storage.url) andextralit.persistence.accessMode=ReadWriteMany.
Configuration¶
Set values with --set or a values file (helm install ... -f my-values.yaml). See values.yaml for all options.
| Value | Default | Notes |
|---|---|---|
extralit.image.repository / tag |
extralit/extralit-server / chart appVersion |
Use extralitdev/extralit-server for builds from main |
extralit.auth.username / password / apiKey / workspace |
extralit / generated / generated / default |
Owner user created on first install only |
extralit.authSecretKey |
generated | Kept across upgrades |
extralit.baseUrl |
"" |
Serve under a path prefix, e.g. /extralit |
extralit.persistence.* |
2Gi ReadWriteOnce at /var/lib/extralit |
With ReadWriteOnce the worker runs on the server's node and rollouts use Recreate; use ReadWriteMany to spread pods |
extralit.ingress.* |
disabled | className, host, annotations, tls |
extralit.hpa.* |
disabled | Needs ReadWriteMany persistence; the chart refuses to render it with ReadWriteOnce |
nodeSelector, tolerations |
none | Applied to server and worker pods |
worker.replicaCount / numWorkers / queues |
1 / 2 / [high, default, ocr] |
Pods × processes per pod; queues in priority order |
extralit.extraEnv |
[] |
Any other EXTRALIT_* server setting |
storage.url, storage.s3.* |
files on the PVC | s3://bucket[/prefix], or http(s)://host[:port]/bucket for MinIO and R2 |
postgresql.enabled / externalDatabase.url |
true / "" |
External format: postgresql+asyncpg://user:pass@host:5432/db |
elasticsearch.useOperator / externalElasticsearch.url |
true / "" |
External format: http://user:pass@host:9200 |
redis.enabled / externalRedis.url |
true / redis://localhost:6379/0 |
redis.persistence.* keeps queued jobs across restarts |
Ingress¶
To expose Extralit through an ingress controller, e.g. on minikube:
minikube addons enable ingress
helm upgrade extralit deploy/k8s -n extralit --reuse-values \
--set extralit.ingress.enabled=true \
--set extralit.ingress.host=extralit.local
echo "$(minikube ip) extralit.local" | sudo tee -a /etc/hosts
External services¶
To use managed services instead of the in-chart ones:
postgresql:
enabled: false
externalDatabase:
url: postgresql+asyncpg://extralit:<password>@db.example.com:5432/extralit
elasticsearch:
useOperator: false
externalElasticsearch:
url: https://elastic:<password>@es.example.com:9200
redis:
enabled: false
externalRedis:
url: redis://redis.example.com:6379/0
storage:
url: s3://my-bucket/extralit
s3:
accessKey: <access-key>
secretKey: <secret-key>
region: us-east-1
Upgrade and uninstall¶
helm uninstall keeps the PostgreSQL and Elasticsearch PVCs. Delete them with kubectl -n extralit delete pvc -l app.kubernetes.io/instance=extralit and kubectl -n extralit delete pvc -l elasticsearch.k8s.elastic.co/cluster-name=extralit if you no longer need the data.
Troubleshooting¶
- Server pod restarts during startup: check
kubectl -n extralit logs deploy/extralit. Migrations and user creation need PostgreSQL and Elasticsearch to be ready; the server retries until its startup probe gives up after 10 minutes. - Pods stuck in
Pending: usually a PVC that can't bind. Checkkubectl -n extralit get pvcand set the*.persistence.storageClassvalues if the cluster has no default StorageClass. With aReadWriteOncevolume the worker is placed on the server's node, so it staysPendinguntil the server is scheduled. - Elasticsearch never becomes healthy: check
kubectl -n extralit get elasticsearchand the operator logs withkubectl -n elastic-system logs statefulset/elastic-operator. A single-node cluster needs about 2 GB of memory. - Search index lost: records are stored in PostgreSQL, so you can rebuild the index with
kubectl -n extralit exec deploy/extralit -- python -m extralit_server search-engine reindex. - Changed
extralit.auth.*after install: the owner user is only created on first install, so changing these values afterwards updates the Secret but not the user's real credentials. - Changed
postgresql.auth.passwordafter install: PostgreSQL only reads it when initializing an empty volume. Change the password inside the database as well, or delete the PostgreSQL PVC to start over.
For support, join the Extralit Slack channel.