Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[terraform] #874: terraform module for GCP #886

Merged
merged 40 commits into from
Jan 24, 2023

Conversation

barroco
Copy link
Contributor

@barroco barroco commented Nov 8, 2022

This PR introduces terraform as a mean to provision the infrastructure required to deploy a DSS as described in #874.
It currently focuses on Google Cloud Engine.

This PR is composed of four key elements:

  1. The terraform module: terraform-google-dss which gathers two dependencies:
    1. terraform-google-kubernetes which creates the kubernetes cluster and related resources (ie IP addresses, DNS etc.) in Google Cloud Engine as described in build/README.md.
    2. terraform-commons-dss which creates a workspace in /build/dev/workspace with the appropriate helper scripts and tanka configuration.
  2. A tool to manage variables shared between modules. Terraform requires to declare variables in every module. To limit repeating terraform variables definitions, a tool is introduced to generate variables files. See /deploy/infrastructure/utils/README.md

The terraform-google-dss is the one exposed to users and requires variables to be passed to it to run. Variables can be provided by various means as described here: https://developer.hashicorp.com/terraform/language/values/variables#assigning-values-to-root-module-variables
For the purpose of providing guidance to users, the documentation uses terraform.tfvars as a mean to provide the variables to the root module.

To test, please follow the steps described in deploy/infrastructure/modules/terraform-google-dss/README.md.

Please note that modules follow the terraform Standard Module Structure and best practice module composition.

Documentation will be consolidated as we add other cloud providers.

If the PR is too large, I am happy to split it up but it will not be possible to test it.

@barroco barroco marked this pull request as ready for review November 8, 2022 17:50
deploy/infrastructure/examples/README.md Outdated Show resolved Hide resolved
deploy/infrastructure/examples/README.md Outdated Show resolved Hide resolved
deploy/infrastructure/examples/README.md Outdated Show resolved Hide resolved
deploy/infrastructure/examples/README.md Outdated Show resolved Hide resolved
deploy/infrastructure/terraform-google-dss/main.tf Outdated Show resolved Hide resolved
deploy/infrastructure/terraform-google-dss/main.tf Outdated Show resolved Hide resolved
@barroco
Copy link
Contributor Author

barroco commented Nov 16, 2022

crdb_node_count default value is not accessible from terraform-google-dss. In the meantime, please set the value in your dss_configuration: crdb_node_count = 3

Edit: The initial intention was to require the node count on each configuration. Values have been added to examples.

Copy link
Member

@BenjaminPelletier BenjaminPelletier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I successfully followed the instructions in deploy/infrastructure/terraform-google-dss/README.md to deploy a single DSS instance using manual DNS configuration. I successfully probed that instance, and successfully destroyed it according to these instructions.

Comments below mostly related to user experience rather than behavior of the system introduced by this PR.

barroco and others added 12 commits January 18, 2023 12:47
- Update build/deploy/db_schemas/README.md
- Change kubernetes_storage_class.tf to google_kubernetes_storage_class.tf
- Add "latest" value to specify default db schema version
- Move variables descriptions to TFVARS.md instead of the example file
- Improve google_zone documentation and add list of options
- Fix us-demo.pem path
- Include dummy auth option in the authentication variable documentation
@barroco
Copy link
Contributor Author

barroco commented Jan 19, 2023

4a4b66b was successfully deployed and the prober generated a successful outcome.

Copy link
Member

@BenjaminPelletier BenjaminPelletier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one new comment and one smaller old comment. But I think it's ready to merge at your discretion.

@barroco barroco merged commit 99651b7 into interuss:master Jan 24, 2023
@barroco barroco deleted the 874-terraform-gke branch January 24, 2023 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants