Skip to content

Install Tectonic on Google Cloud Platform with Terraform

Use this guide to manually install a Rancher HA cluster on a GCP account.

Getting Started

First, clone the Terraform Rancher repository:

git clone https://github.com/design4pro/terraform-rancher.git
cd terraform-rancher

Initialise Terraform:

terraform init platforms/gcp

Configure your GCP credentials. See the Terraform Google provider docs for details.

export GOOGLE_APPLICATION_CREDENTIALS=~/.gcp/my-credentials.json

Customize the deployment

Customizations to the base installation live in examples/terraform.tfvars.gcp. Export a variable that will be your cluster identifier:

export CLUSTER=my-cluster
export GOOGLE_PROJECT=my-project-id

Create a build directory to hold your customizations and copy the example file into it:

mkdir -p build/${CLUSTER}
cp examples/terraform.tfvars.gcp build/${CLUSTER}/terraform.tfvars

Edit the parameters with your GCP details: project id, domain name, etc. View all of the GCP specific options and the common Rancher variables).

Deploy the cluster

Test out the plan before deploying everything:

terraform plan -var-file=build/${CLUSTER}/terraform.tfvars platforms/gcp

Next, deploy the cluster:

terraform apply -var-file=build/${CLUSTER}/terraform.tfvars platforms/gcp

This should run for a little bit, and when complete, your Rancher HA cluster should be ready.