Installation

Install KLearn on your Kubernetes cluster

Installation

This guide covers installing KLearn on a Kubernetes cluster for development or production use.

Requirements

ComponentMinimumRecommended
Kubernetes1.26+1.29+
CPU4 cores8+ cores
Memory16 GB32 GB
Storage50 GB100 GB

Required Components

  • kubectl - Kubernetes CLI
  • Helm 3 - Kubernetes package manager
  • Docker - Container runtime (for building images)

Installation Methods

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

VariableDescriptionDefault
DATABASE_URLPostgreSQL connection stringpostgresql+asyncpg://...
REDIS_URLRedis connection stringredis://localhost:6379/0
MINIO_ENDPOINTMinIO server addresslocalhost:9000
MLFLOW_TRACKING_URIMLflow tracking serverhttp://localhost:5000
K8S_NAMESPACEKubernetes namespaceklearn

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