---
title: Adding a new cluster
slug: hosty/adding-a-new-cluster
createdAt: 2026-11-08T11:27:49.007Z
---

A cluster is where projects run. Each cluster has its own VPC, EKS cluster, load balancers, database, file storage, VPN and alarms, in the AWS region you choose. This page shows how to add one. See [Infrastructure architecture](https://wiki.systemseed.com/hosty/infrastructure-architecture) for what's inside.

## Before you start

- The [Hosty blueprint is applied](https://wiki.systemseed.com/hosty/applying-hosty-blueprint), and its state is in S3.
- You are in `administrators` in `main.tf`, with a session from `hosty auth`. OpenTofu sets up the inside of the new cluster with your user, and only administrators get access to it.
- `tofu plan` shows no changes.
- On a new AWS account, the service-linked role of Auto Scaling exists. It encrypts the disks of the servers, and the key that does it can only name an existing role. AWS creates the role the first time the account uses Auto Scaling, so for the first cluster of an account, create it yourself. If it already exists, the command says so, and that's fine:

  ```bash
  aws iam create-service-linked-role --aws-service-name autoscaling.amazonaws.com
  ```

## 1. Describe the cluster in main.tf

In `terraform/main.tf`, add a `module "cluster_<cluster>"` block. The easiest way is to copy an existing one, or the commented one in `terraform/main.tf.example`, and change the values. The comments in it explain each setting.

The settings you have to look at:

| Setting                                             | What to set                                                                                                                                                         |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cluster_name`                                      | A short name in lowercase, the same as in the name of the module, for example `phoenix`. It goes into the names of AWS resources and into `hosty.yaml` of projects. |
| `cluster_region`                                    | The AWS region of the cluster.                                                                                                                                      |
| `k8s_version`                                       | A version of Kubernetes that EKS supports.                                                                                                                          |
| `vpc_cidr`                                          | A range that doesn't overlap with other clusters: `10.1.0.0/16`, `10.2.0.0/16` and so on.                                                                           |
| `node_instances_*`                                  | Type, number and disk size of the production and development servers. Both groups must have the same `node_instances_arch`.                                         |
| `rds_engine`, `rds_engine_version`, `rds_instances` | The database: `aurora-mysql` or `aurora-postgresql`, shared by all projects of the cluster.                                                                         |
| `cluster_endpoint_public_access`                    | `true` for now, with `cluster_endpoint_public_access_cidrs = ["0.0.0.0/0"]`. See below.                                                                             |

Optional settings, all off by default:

| Setting                    | What it does                                                                                                                                                                                |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `single_availability_zone` | Runs the servers and the database in one zone. Cheaper, but the sites go down if that zone fails.                                                                                           |
| `alb_cloudflare_only`      | The production load balancer accepts requests only from Cloudflare. Use it when all production domains go through Cloudflare.                                                               |
| `internal_load_balancer`   | Applications reach the production domains of projects inside the VPC.                                                                                                                       |
| `opensearch_enabled`       | Creates an OpenSearch domain for the projects. The account needs the service-linked role of OpenSearch Service first, see the description of the setting in `modules/cluster/variables.tf`. |

Keep the API of the cluster open to the internet while you create it. The VPN is created together with the cluster, so you can't connect to it before. Once the cluster works, [enable VPN-only access](https://wiki.systemseed.com/hosty/enabling-vpn-only-access).

Leave the projects for later. You can add them once the cluster is ready.

## 2. Create the cluster

A new module needs `tofu init` before the first apply:

```bash
cd /src/terraform
tofu init
tofu apply
```

Check the plan and confirm it. It takes a while, usually more than 15 minutes. Don't interrupt it.

## 3. Check the cluster

1. Point kubectl and Helm to the cluster and check that its servers are ready:

   ```bash
   aws eks update-kubeconfig --name <cluster> --region <cluster region>
   kubectl get nodes
   ```
2. AWS sends an email to `alarms_email_address` to confirm the subscription to the alarms of the cluster. Click the link in it, otherwise the alarms don't arrive by email. They still go to Slack.
3. The VPN profiles of the cluster are in the S3 bucket `vpn.<hosted zone>`, as `<username>.<cluster>.ovpn`. Every administrator gets one, and so does every user of a project on this cluster.

## Next steps

1. [Enable VPN-only access](https://wiki.systemseed.com/hosty/enabling-vpn-only-access).
2. [Add projects](https://wiki.systemseed.com/hosty/7xVm-adding-a-new-project) with `cluster` set to the name of the new cluster.

To remove a cluster, see [Deleting a cluster](https://wiki.systemseed.com/hosty/deleting-a-cluster).
