tree: eb15a5ddf86d54aab90e5c74059edf752ec4c013 [path history] [tgz]
  1. .kafka-workflows.apache-beam-testing.tfbackend
  2. .terraform.lock.hcl
  3. cluster.tf
  4. copyme.apache-beam-testing.tfbackend
  5. iam.tf
  6. kafka-workflows.apache-beam-testing.tfvars
  7. outputs.tf
  8. prerequisites.tf
  9. provider.tf
  10. README.md
  11. us-central1.apache-beam-testing.tfvars
  12. us-west1.apache-beam-testing.tfvars
  13. variables.tf
  14. versions.tf
.test-infra/terraform/google-cloud-platform/google-kubernetes-engine/README.md

Overview

This module provisions a private Google Kubernetes Engine cluster in the Google Cloud Platform (GCP).

Requirements and Usage

See Google Cloud Platform requirements for details on requirements and usage.

IMPORTANT Prerequisites

This module assumes the following pre-existing resources:

Step 1. Create a new .tfbackend file in the .test-infra/terraform/google-cloud-platform/google-kubernetes-engine directory

Create a new file to specify the backend partial configuration. See below for details on naming convention and expected content. apache-beam-testing usage should be version controlled in this repository.

Name the file to communicate intent

If using apache-beam-testing, a suggested naming convention is .<cluster-name-prefix>.apache-beam-testing.tfbackend. Note this is conventionally a dot file but doesn't have to be.

For example, .my-cluster.apache-beam-testing.tfbackend communicates to others that the backend specifies the state of a Kubernetes cluster with an ID prefix my-cluster in the apache-beam-testing project.

Content

The following is the expected content of the .tfbackend file, where bucket references the name of the Google Cloud Storage bucket created as a pre-requisite.

See below for details on naming convention and expected content. apache-beam-testing usage should be version controlled in this repository.

If using apache-beam-testing:

.test-infra/terraform/google-cloud-platform/google-kubernetes-engine/copyme.apache-beam-testing.tfbackend contains a template with the following. Just change <cluster-name-prefix>.

bucket = "b507e468-52e9-4e72-83e5-ecbf563eda12"
prefix = ".test-infra/terraform/google-cloud-platform/google-kubernetes-engine/<cluster-name-prefix>"

Step 2. Create .tfvars file

Create a new file to specify a .tfvars file for your new Kubernetes cluster for use with the terraform cli -var-file flag. See below for details on naming convention and expected content. apache-beam-testing usage should be version controlled in this repository.

Name the file to communicate intent

If using apache-beam-testing, a suggested naming convention is <cluster-name-prefix>.<region>.apache-beam-testing.tfvars.

For example, my-cluster.us-central1.apache-beam-testing.tfvars communicates to others that the

Both .test-infra/terraform/google-cloud-platform/google-kubernetes-engine/us-central1.apache-beam-testing.tfvars and .test-infra/terraform/google-cloud-platform/google-kubernetes-engine/us-west1.apache-beam-testing.tfvars are example starter .tfvars files specific to apache-beam-testing for the targeted region. Editing the .tfvars file in an IDE installed with a terraform plugin and it will prompt you for the remaining variables.

Step 3. Initialize and apply the terraform module.

Where:

CLUSTER_PREFIX=<cluster-id-prefix>
CONFIG=$CLUSTER_PREFIX.apache-beam-testing.tfbackend # file name only without the directory
DIR=.test-infra/terraform/google-cloud-platform/google-kubernetes-engine
VARS=$CLUSTER_PREFIX.us-west1.apache-beam-testing.tfvars

Run:

terraform -chdir=$DIR init -backend-config=$CONFIG
terraform -chdir=$DIR apply -var-file=$VARS

You will be prompted for any remaining variables.