# LLMHosts.com Kubernetes Deployment

Helm chart for deploying LLMHosts.com to any Kubernetes cluster (K3s, EKS, GKE, AKS).

## Prerequisites

- Kubernetes 1.28+
- Helm 3.x
- Container images pushed to GHCR (automatic via Release workflow)

## Quick Start

```bash
# From the repo root
helm install llmhosts infrastructure/k8s/ \
  --set ingress.hosts[0].host=your-domain.com

# With custom values
helm install llmhosts infrastructure/k8s/ -f my-values.yaml
```

## Architecture

```
Ingress (Traefik/nginx)
  ├── /v1, /health, /docs, /admin → backend (FastAPI :4000)
  └── / (everything else)         → frontend (Next.js :3000)
```

## Configuration

See `values.yaml` for all configurable parameters. Key settings:

| Parameter | Description | Default |
|-----------|-------------|---------|
| `backend.replicaCount` | Backend replicas | `1` |
| `frontend.replicaCount` | Frontend replicas | `1` |
| `ingress.enabled` | Enable ingress | `true` |
| `ingress.className` | Ingress class | `traefik` |
| `database.type` | `sqlite` or `postgresql` | `sqlite` |
| `headscale.enabled` | Enable Hive coordination | `false` |

## Migration from Docker Compose

This chart mirrors the Docker Compose production setup:
- Same container images (GHCR)
- Same routing rules (backend API paths, frontend catch-all)
- Same environment variables
- SQLite persistence via PVC (or switch to PostgreSQL for HA)

## Production Notes

- For HA: switch `database.type` to `postgresql` and increase `replicaCount`
- For GPU nodes: add `nodeSelector` or `tolerations` in values.yaml
- TLS: configure cert-manager or provide existing secret
