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

# Deployment

> Deploy the Formal Kubernetes Operator using Helm

The operator is distributed as a Helm chart and a Docker image hosted on ECR.

## Installation

Add the Formal Helm repository:

```bash theme={null}
helm repo add formal https://formalco.github.io/helm-charts
```

Install the operator:

```bash theme={null}
helm install formal-kubernetes-operator formal/kubernetes-operator \
  --set formalAPIKey=<your-formal-api-key>
```

This will:

1. Install the CRDs (FormalResource, FormalListener, FormalNativeUser)
2. Create a ServiceAccount with the necessary RBAC permissions
3. Deploy the operator

## Configuration

| Parameter             | Default   | Description                                                          |
| --------------------- | --------- | -------------------------------------------------------------------- |
| `formalAPIKey`        | `""`      | Formal API key (required)                                            |
| `image.tag`           | `latest`  | Docker image tag                                                     |
| `image.pullPolicy`    | `Always`  | Image pull policy                                                    |
| `replicaCount`        | `1`       | Number of operator replicas                                          |
| `pullWithCredentials` | `false`   | Set to `true` if using the `ecr-cred` chart to fetch ECR credentials |
| `resources`           | See below | CPU/memory requests and limits                                       |
| `metricsPort`         | `8080`    | Bind port for the metrics server                                     |

Default resource requests and limits:

```yaml theme={null}
resources:
  requests:
    cpu: 100m
    memory: 128Mi
  limits:
    cpu: 500m
    memory: 256Mi
```

## Non-AWS Environments

If your cluster cannot pull from ECR directly, deploy the `ecr-cred` Helm chart first, then set `pullWithCredentials=true`:

```bash theme={null}
helm install formal-kubernetes-operator formal/kubernetes-operator \
  --set formalAPIKey=<your-formal-api-key> \
  --set pullWithCredentials=true
```
