Skip to content

Commit

Permalink
updates doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarhee committed Aug 8, 2019
1 parent c18162d commit 4453962
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions README.md
Expand Up @@ -30,37 +30,50 @@ Clusters

To ensure all your regions have standardized deployments, in your Terraform variables (`TF_VAR_varname` or in `terraform.tfvars`), ensure that you have set `count` (number of nodes per cluster), `plan_primary`, and `plan_node`. This will apply to **all** clusters managed by this project.

Using the `Makefile`, you can quickly add a new cluster definition using:

```bash
make facility="ewr1" cluster_id="control" define-cluster
```
To add new clusters to a cluster pool, add the new facility to the `facilities` map:

and then apply your new cluster module (if you do not wish to apply any other outstanding state changes via `terraform apply`):
```
variable "facilities" {
type = "map"
default = {
newark = "ewr1"
narita = "nrt1"
sanjose = "sjc1"
}
}
```

by adding a line such as:
```
make cluster_name="cluster_control_ewr1" apply-cluster
...
chicago = "ord1"
}
}
```
where `cluster_name` is the module name for that cluster in `3-cluster-inventory.tf`, if you wish to review this manually before applying. This will follow the format `cluster_$cluster-id_$facility`.

<h3>Manually defining a Cluster</h3>
<h3>Manually defining a Cluster, or adding a new cluster pool</h3>

To create a cluster manually, in `3-cluster-inventory.tf` (this is ignored by git--your initial cluster setup is in `2-clusters.tf`, and is tracked), instantiate a new `cluster_pool` module:

```
module "cluster_name_nrt1" {
source = "modules/cluster_pool"
module "manual_cluster" {
source = "./modules/cluster_pool"
cluster_name = "your_cluster_name"
count = "${var.count}"
cluster_name = "manual_cluster"
node_count = "${var.node_count}"
plan_primary = "${var.plan_primary}"
plan_node = "${var.plan_node}"
facility = "nrt1"
facilities = "${var.facilities}"
primary_facility = "${var.primary_facility}"
auth_token = "${var.auth_token}"
project_id = "${var.project_id}"
ssh_private_key_path = "${var.ssh_private_key_path}"
anycast_ip = "${packet_reserved_ip_block.anycast_ip.address}"
}
```
This creates a single-controller cluster, with `count` number of agent nodes in `facility`.
This creates a single-controller cluster, with `count` number of agent nodes for each `facility` in the `facilities` map.

<h3>Demo Project</h3>

Expand Down

0 comments on commit 4453962

Please sign in to comment.