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

# 1. Cloud resources

> Create the cluster, databases, storage and service accounts in your project with OpenTofu.

The release bundle, `jedify-deploy-<version>.tar.gz`, holds everything you run on the install host. Unpack it and work from its directory:

```sh theme={null}
tar -xzf jedify-deploy-<version>.tar.gz
cd jedify-deploy-<version>
```

## Set your values

```sh theme={null}
cp terraform/terraform.tfvars.example terraform/terraform.tfvars
```

Set these in `terraform/terraform.tfvars`:

```hcl theme={null}
project_id         = "acme-jedify"
region             = "us-central1"
firestore_location = "us-central1"   # can never be changed
name_prefix        = "acme-jedify"   # unique: it starts every bucket name
enable_zitadel     = true            # the sign-in service's database
```

The rest have working defaults. The file explains each one, including how to install into a network you already have ([Install into an existing network](https://docs.jedify.com/self-hosted/gcp/install/existing-network.md)).

## Create the state bucket

OpenTofu keeps its state in your project, never on the install host:

```sh theme={null}
gcloud storage buckets create gs://acme-jedify-tfstate \
  --project=acme-jedify --location=us-central1 --uniform-bucket-level-access
gcloud storage buckets update gs://acme-jedify-tfstate --versioning
```

Versioning is what lets you restore the state after a bad apply. Turn it on now: it does not apply to files written before.

## Apply

```sh theme={null}
cd terraform
tofu init -backend-config="bucket=acme-jedify-tfstate" -backend-config="prefix=jedify"
tofu apply
```

The first apply takes 20 to 30 minutes, most of it the cluster and Cloud SQL.

Then point `kubectl` at the new cluster:

```sh theme={null}
$(tofu output -raw cluster_get_credentials_command)
cd ..
```

## Check it

```sh theme={null}
kubectl get namespace kube-system
```

Expected: `kube-system   Active`. On GKE Autopilot the cluster has no nodes until something runs on it, so `kubectl get nodes` may print nothing yet.

## What it made

| Resource | For |
| - | - |
| GKE Autopilot cluster | Everything Jedify runs. Its pods run on Arm where the region offers it, otherwise on amd64. |
| Firestore (MongoDB compatibility) | The application's documents |
| Cloud SQL for PostgreSQL | The application's queues and the sign-in service |
| Memorystore | The application's cache and the realtime server |
| Cloud Storage buckets | Uploaded files, and each account's context repositories |
| Secret Manager secrets | The application's generated settings and keys, and the sign-in service's |
| Service accounts | One each for the application, the model gateway and External Secrets, bound to their Kubernetes service accounts |
| Artifact Registry repository | Where you copy the images, if you do |

You never copy any of these names by hand. The next steps read them from OpenTofu.


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