Skip to content

Commit

Permalink
Adds clarifications to README, adds tidb and monitor port to outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlerche committed May 21, 2019
1 parent 88f32c6 commit 843d3e9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/gcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ The default setup will create a new VPC, two subnetworks, and an f1-micro instan
The terraform script expects three environment variables. You can let Terraform prompt you for them, or `export` them ahead of time. If you choose to export them, they are:

* `TF_VAR_GCP_CREDENTIALS_PATH`: Path to a valid GCP credentials file
* `TF_VAR_GCP_CREDENTIALS_PATH`: Path to a valid GCP credentials file. It is generally considered a good idea to create a service account to be used by Terraform. See [this page](https://cloud.google.com/iam/docs/creating-managing-service-accounts) for more information on how to manage them. See [this page](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) for creating and managing service account keys which, when downloaded, will be the needed credentials file.
* `TF_VAR_GCP_REGION`: The region to create the resources in, for example: `us-west1`
* `TF_VAR_GCP_PROJECT`: The name of the GCP project

It is generally considered a good idea to create a service account to be used by Terraform. See https://cloud.google.com/iam/docs/creating-managing-service-accounts for more information on how to manage them.


The service account should have sufficient permissions to create resources in the project. The `Project Editor` primitive will accomplish this.

Expand Down
4 changes: 4 additions & 0 deletions deploy/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ EOS
resource "null_resource" "deploy-tidb-cluster" {
depends_on = ["null_resource.setup-env", "local_file.tidb-cluster-values", "google_container_node_pool.pd_pool", "google_container_node_pool.tikv_pool", "google_container_node_pool.tidb_pool"]

triggers {
values = "${data.template_file.tidb_cluster_values.rendered}"
}

provisioner "local-exec" {
command = <<EOS
helm upgrade --install tidb-cluster ${path.module}/charts/tidb-cluster --namespace=tidb -f ${local.tidb_cluster_values_path}
Expand Down
8 changes: 8 additions & 0 deletions deploy/gcp/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ output "tidb_ilb_ip" {
value = "${data.external.tidb_ilb_ip.result["ip"]}"
}

output "tidb_port" {
value = "${data.external.tidb_port.result["port"]}"
}

output "monitor_ilb_ip" {
value = "${data.external.monitor_ilb_ip.result["ip"]}"
}

output "monitor_port" {
value = "${data.external.monitor_port.result["port"]}"
}

output "how_to_ssh_to_bastion" {
value = "gcloud compute ssh bastion --zone ${var.GCP_REGION}-a"
}
Expand Down

0 comments on commit 843d3e9

Please sign in to comment.