Installation
Install KLearn on your Kubernetes cluster
Installation
This guide covers installing KLearn on a Kubernetes cluster for development or production use.
Requirements
| Component | Minimum | Recommended |
|---|---|---|
| Kubernetes | 1.26+ | 1.29+ |
| CPU | 4 cores | 8+ cores |
| Memory | 16 GB | 32 GB |
| Storage | 50 GB | 100 GB |
Required Components
- kubectl - Kubernetes CLI
- Helm 3 - Kubernetes package manager
- Docker - Container runtime (for building images)
Installation Methods
Method 1: Helm Chart (Recommended)
The easiest way to install KLearn is using our Helm chart:
# Add KLearn Helm repository
helm repo add klearn https://klearn-dev.github.io/charts
helm repo update
# Create namespace
kubectl create namespace klearn
# Install KLearn
helm install klearn klearn/klearn \
--namespace klearn \
--values values.yaml
Method 2: Local Development with kind
For local development and testing:
# Clone the repository
git clone https://github.com/klearn-dev/klearn.git
cd klearn
# Create kind cluster with registry
./scripts/create-kind-cluster.sh
# Build and deploy
make build push deploy
Method 3: Kustomize
For GitOps workflows:
# Clone the repository
git clone https://github.com/klearn-dev/klearn.git
cd klearn
# Apply with kustomize
kubectl apply -k deploy/kubernetes/overlays/prod
Configuration
Helm Values
Create a values.yaml file to customize your installation:
# Backend configuration
backend:
replicas: 2
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 2000m
memory: 2Gi
# Frontend configuration
frontend:
replicas: 2
# Database
postgresql:
enabled: true
auth:
username: klearn
password: your-secure-password
database: klearn
# Object Storage
minio:
enabled: true
rootUser: minioadmin
rootPassword: your-secure-password
# ML Tracking
mlflow:
enabled: true
# LLM Service
ollama:
enabled: true
model: llama3.2
Environment Variables
| Variable | Description | Default |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgresql+asyncpg://... |
REDIS_URL | Redis connection string | redis://localhost:6379/0 |
MINIO_ENDPOINT | MinIO server address | localhost:9000 |
MLFLOW_TRACKING_URI | MLflow tracking server | http://localhost:5000 |
K8S_NAMESPACE | Kubernetes namespace | klearn |
Verify Installation
Check that all pods are running:
# Check pods
kubectl get pods -n klearn
# Expected output:
# NAME READY STATUS RESTARTS AGE
# klearn-backend-xxx 1/1 Running 0 2m
# klearn-frontend-xxx 1/1 Running 0 2m
# klearn-operator-xxx 1/1 Running 0 2m
# klearn-minio-xxx 1/1 Running 0 2m
# klearn-mlflow-xxx 1/1 Running 0 2m
# klearn-postgresql-xxx 1/1 Running 0 2m
# klearn-redis-xxx 1/1 Running 0 2m
Check CRDs:
kubectl get crd | grep klearn
# Expected output:
# klearnjobs.klearn.klearn.dev
# klearnmodels.klearn.klearn.dev
Troubleshooting
Pods not starting
Check pod logs:
kubectl logs -n klearn deployment/klearn-backend
kubectl logs -n klearn deployment/klearn-operator
Database connection issues
Verify PostgreSQL is running:
kubectl exec -it -n klearn deployment/klearn-postgresql -- psql -U klearn -c "SELECT 1"
Storage issues
Check MinIO connectivity:
kubectl port-forward -n klearn svc/klearn-minio 9000:9000 &
curl http://localhost:9000/minio/health/live
Next Steps
- Quick Start - Train your first model
- Configuration - Advanced configuration options
- Architecture - Understand how KLearn works