-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updating root module for convergence. Signed-off-by: Erin Atkinson <[email protected]> * update secondary module to plumb disk size. Signed-off-by: Erin Atkinson <[email protected]> * readme and output updates. Signed-off-by: Erin Atkinson <[email protected]> * organizing the vars and outputs. Signed-off-by: Erin Atkinson <[email protected]>
- Loading branch information
1 parent
7a82324
commit 4ef9b9e
Showing
14 changed files
with
240 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,61 @@ | ||
#Terraform Enterprise HA (Beta) Example | ||
# Terraform Enterprise HA (Beta) Example | ||
|
||
This example assumes you have already set up your gcp project with the required prereqs: | ||
|
||
* VPC | ||
* Subnet specifically for Terrafrom Enterprise | ||
* Firewall rules as outlined [in the instructions](link_to_website_instructions) | ||
* A valid certificate and ssl policy in gcp. (If you are not going to use a google managed ssl certificate, plesae [read the instructions here on what to comment out](link_to_instructions)) | ||
* An IP address and DNS entry for the front end load balancer | ||
* A DNS Zone in gcp | ||
* A license file provided by your Technical Account Manager | ||
* VPC | ||
* Subnet specifically for Terrafrom Enterprise | ||
* Firewall rules as outlined [in the instructions](link_to_website_instructions) | ||
* A valid certificate and ssl policy in gcp. (If you are not going to use a google managed ssl certificate, plesae [read the instructions here on what to comment out](link_to_instructions)) | ||
* An IP address and DNS entry for the front end load balancer | ||
* A DNS Zone in gcp | ||
* A license file provided by your Technical Account Manager | ||
|
||
With this code you can either create a single instance, or a build a cluster: | ||
|
||
![basic architecture diagram](tfeha_basic_diagram.jpg) | ||
|
||
## Change to the example directory | ||
|
||
``` | ||
```bash | ||
cd examples/root-example | ||
``` | ||
|
||
## Install Terraform | ||
|
||
Install Terraform if it is not already installed (visit [terraform.io](https://terraform.io) for other distributions): | ||
|
||
``` | ||
```bash | ||
../terraform-install.sh | ||
``` | ||
|
||
## Set the desired options in the module block | ||
|
||
You'll need to update the following settings to your set up: | ||
|
||
* project: name of the project | ||
* creds: json file name | ||
* publicip: The IP address to attach to the load balancer | ||
* domain: domain to use | ||
* dnszone: the name of the dns zone in gcp | ||
* cert: the api url of the google certficiate to use | ||
* sslpolicy: name of the ssl policy to use | ||
* subnet: subnet to deploy into (this should be reserved for tfe) | ||
* project: name of the project | ||
* creds: json file name | ||
* publicip: The IP address to attach to the load balancer | ||
* domain: domain to use | ||
* dnszone: the name of the dns zone in gcp | ||
* cert: the api url of the google certficiate to use | ||
* sslpolicy: name of the ssl policy to use | ||
* subnet: subnet to deploy into (this should be reserved for tfe) | ||
|
||
This example is set to spin up a single instance, but the `primary_count` and `worker_count` can be updated to build a cluster instead. | ||
This example is set to spin up a single instance, but the `primary_count` and `secondary_count` can be updated to build a cluster instead. | ||
|
||
## Run Terraform | ||
``` | ||
|
||
```bash | ||
terraform init | ||
terraform apply | ||
``` | ||
|
||
## Wait for the application to load | ||
|
||
The replicated console url will output along with the password. | ||
The replicated console url will output along with the password. | ||
|
||
![output](output_example.png) | ||
|
||
You can log into that dashboard at that url and wait for the application to be ready. This can take up to 30 minutes! Once complete use the `Open` link to set up the admin user and initial organization. | ||
You can log into that dashboard at that url and wait for the application to be ready. This can take up to 30 minutes! Once complete use the `Open` link to set up the admin user and initial organization. | ||
|
||
![application started](app_started.png) | ||
![application started](app_started.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
module "lb" { | ||
source = "./modules/lb" | ||
domain = "${var.domain}" | ||
publicIP = "${var.publicip}" | ||
cert = "${var.cert}" | ||
sslpolicy = "${var.sslpolicy}" | ||
source = "./modules/lb" | ||
domain = "${var.domain}" | ||
publicIP = "${var.public_ip}" | ||
cert = "${var.certificate}" | ||
sslpolicy = "${var.ssl_policy}" | ||
primary_instances = "${google_compute_instance.primary.*.self_link}" | ||
instance_group = "${google_compute_instance_group.primaries.self_link}" | ||
frontenddns = "${var.frontenddns}" | ||
instance_group = "${google_compute_instance_group.primaries.self_link}" | ||
frontenddns = "${var.frontend_dns}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Terraform Enterprise: High Availability - Instance Template Submodule | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| bootstrap\_token\_id | bootstrap token id | string | n/a | yes | | ||
| bootstrap\_token\_suffix | bootstrap token suffix | string | n/a | yes | | ||
| cluster\_endpoint | the cluster endpoint | string | n/a | yes | | ||
| image\_family | image family | string | n/a | yes | | ||
| install\_type | type of install - poc or production | string | n/a | yes | | ||
| ptfe\_subnet | subnet to deploy into | string | n/a | yes | | ||
| region | The region to install into. | string | n/a | yes | | ||
| release\_sequence | Replicated release sequence | string | n/a | yes | | ||
| repl\_data | console | string | n/a | yes | | ||
| secondary\_machine\_type | Type of machine to use | string | n/a | yes | | ||
| setup\_token | setup token | string | n/a | yes | | ||
| boot\_disk\_size | The size of the boot disk to use for the instances | string | `"40"` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| secondary\_template | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Terraform Enterprise: High Availability - Load Balancer Submodule | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| cert | certificate for the load balancer | string | n/a | yes | | ||
| domain | domain | string | n/a | yes | | ||
| frontenddns | front end url name | string | n/a | yes | | ||
| instance\_group | primary instance group | string | n/a | yes | | ||
| primary\_instances | primary instances | list | n/a | yes | | ||
| publicIP | External-facing IP address for PTFE application | string | n/a | yes | | ||
| sslpolicy | SSL policy for the cert | string | n/a | yes | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| cluster\_endpoint | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
output "installer_dashboard_url" { | ||
value = "https://${google_compute_instance.primary.0.network_interface.0.access_config.0.nat_ip}:8800" | ||
description = "URL to access the Installer Dashboard." | ||
output "application_endpoint" { | ||
value = "https://${var.frontend_dns}.${substr(data.google_dns_managed_zone.dnszone.dns_name, 0, length(data.google_dns_managed_zone.dnszone.dns_name) - 1)}" | ||
description = "The URI to access the Terraform Enterprise Application." | ||
} | ||
|
||
output "installer_dashboard_password" { | ||
value = "${random_pet.console_password.id}" | ||
description = "Password for the Installer Dashboard." | ||
output "application_health_check" { | ||
value = "https://${var.frontend_dns}.${substr(data.google_dns_managed_zone.dnszone.dns_name, 0, length(data.google_dns_managed_zone.dnszone.dns_name) - 1)}/_health_check" | ||
description = "The URI for the Terraform Enterprise Application health check." | ||
} | ||
|
||
/*output "replicated_console_url" { | ||
value = "https://${var.frontenddns}.${substr(data.google_dns_managed_zone.dnszone.dns_name, 0, length(data.google_dns_managed_zone.dnszone.dns_name) - 1)}/dashboard" | ||
}*/ | ||
|
||
output "primary_public_ip" { | ||
value = "${var.publicip}" | ||
description = "Front end IP for the load balancer." | ||
output "installer_dashboard_password" { | ||
value = "${random_pet.console_password.id}" | ||
description = "The password to access the installer dashboard." | ||
} | ||
|
||
output "tfe_endpoint" { | ||
value = "https://${var.frontenddns}.${substr(data.google_dns_managed_zone.dnszone.dns_name, 0, length(data.google_dns_managed_zone.dnszone.dns_name) - 1)}" | ||
description = "Application URL" | ||
output "installer_dashboard_url" { | ||
value = "https://${google_compute_instance.primary.0.network_interface.0.access_config.0.nat_ip}:8800" | ||
description = "The URL to access the installer dashboard." | ||
} | ||
|
||
output "tfe_health_check" { | ||
value = "https://${var.frontenddns}.${substr(data.google_dns_managed_zone.dnszone.dns_name, 0, length(data.google_dns_managed_zone.dnszone.dns_name) - 1)}/_health_check" | ||
description = "Health Check URL" | ||
} | ||
output "primary_public_ip" { | ||
value = "${var.public_ip}" | ||
description = "The Public IP for the load balancer to use." | ||
} |
Oops, something went wrong.