> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scandrix.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Kubernetes Deployment (Helm)

> Production-grade Kubernetes deployment guide with Helm chart, Horizontal Pod Autoscaling (HPA), and secrets management.

For high-throughput enterprise environments, ScanDrix provides official Helm charts and Kubernetes manifests for deployment on **AWS EKS**, **Google Cloud GKE**, **Azure AKS**, or bare-metal Kubernetes clusters.

## Architecture topology

A complete Kubernetes deployment separates API ingestion from asynchronous review workers:

```
[Ingress (TLS)]
       │
       ▼
[scandrix-api] (Go REST Service, 8080)
       │
       ├──► [PostgreSQL] (Row-Level Security, pgxpool)
       │
       └──► [RabbitMQ] (Quorum Queues & Delayed Exchange)
                  │
                  ▼
          [scandrix-worker] (Auto-scaled by queue depth via KEDA / HPA)
                  │
                  └──► [Ephemeral Tree-sitter & Model Runners]
```

## Quick installation with Helm

```bash theme={null}
# Add official ScanDrix Helm repository
helm repo add scandrix https://charts.scandrix.dev
helm repo update

# Install ScanDrix into dedicated namespace
helm install scandrix scandrix/scandrix \
  --namespace scandrix-system \
  --create-namespace \
  --values values.production.yaml
```

## Production `values.yaml` configuration

```yaml theme={null}
global:
  domain: "scandrix.internal.yourcompany.com"

api:
  replicaCount: 3
  resources:
    limits:
      cpu: 2000m
      memory: 4Gi
    requests:
      cpu: 500m
      memory: 1Gi
  env:
    PORT: "8080"
    DB_MAX_CONNS: "50"
    DB_MIN_CONNS: "5"

worker:
  replicaCount: 5
  autoscaling:
    enabled: true
    minReplicas: 3
    maxReplicas: 50
    targetRabbitMQQueueLength: 5

database:
  host: "postgres-cluster.internal.vpc"
  port: 5432
  name: "scandrix_prod"
  sslmode: "require"
  existingSecret: "scandrix-db-credentials"

rabbitmq:
  clusterHost: "rabbitmq.internal.vpc"
  port: 5672
  existingSecret: "scandrix-mq-credentials"
```

## Horizontal Pod Autoscaler (HPA)

The review worker pool scales dynamically based on the number of unacknowledged pull request diffs in RabbitMQ:

```yaml theme={null}
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: scandrix-worker-scaler
  namespace: scandrix-system
spec:
  scaleTargetRef:
    name: scandrix-worker
  minReplicaCount: 3
  maxReplicaCount: 40
  triggers:
    - type: rabbitmq
      metadata:
        queueName: "scandrix.reviews.v1"
        targetQueueValue: "2"
```

> [!TIP]
>
> Setting `targetQueueValue: "2"` guarantees that whenever a PR spike occurs (e.g. at the end of a sprint), workers immediately scale up to review pull requests in parallel.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.