Kubernetes Installation
CleverThis ships a Helm chart for production Kubernetes deployments. This path is recommended for teams that need high availability, horizontal scaling, or multi-environment cluster management.
Prerequisites
- Kubernetes 1.28+
- Helm 3.12+
- An ingress controller (nginx-ingress or similar)
- A cert-manager installation (for TLS)
- An external PostgreSQL instance (RDS, Cloud SQL, Azure Database, etc.)
- An external Redis instance (ElastiCache, Upstash, etc.)
Add the Helm repository
helm repo add cleverthis https://charts.cleverthis.com
helm repo update
Create the values file
Copy the default values and edit:
helm show values cleverthis/cleverthis > values.yaml
Key values to set:
global:
domain: api.your-domain.com
webappDomain: app.your-domain.com
api:
replicas: 2
env:
DATABASE_URL: "postgresql://user:pass@your-rds-host:5432/cleverthis"
REDIS_URL: "redis://your-redis-host:6379/0"
SECRET_KEY: "your-secret-key"
OPENAI_API_KEY: "sk-..."
webapp:
replicas: 2
env:
NEXTAUTH_SECRET: "your-nextauth-secret"
NEXTAUTH_URL: "https://app.your-domain.com"
ingress:
enabled: true
className: nginx
tls:
enabled: true
certManager: true
Install the chart
kubectl create namespace cleverthis
helm install cleverthis cleverthis/cleverthis \
--namespace cleverthis \
--values values.yaml
Run migrations as a Job
The chart includes a pre-install Helm hook that runs Alembic migrations before the API pods start. Check its status:
kubectl get jobs -n cleverthis
kubectl logs job/cleverthis-migrate -n cleverthis
Scaling
Scale the API and webapp independently:
kubectl scale deployment cleverthis-api --replicas=4 -n cleverthis
kubectl scale deployment cleverthis-webapp --replicas=3 -n cleverthis
Coming soon
Helm chart values reference, HorizontalPodAutoscaler configuration, and multi-region deployment patterns are being documented.