open-nomad/e2e/terraform
Michael Schurter 5f3a71d0b9 docs: update scripts to 0.12.4 2020-09-09 15:22:37 -07:00
..
config e2e: move configurations into profile-specific directories (#8828) 2020-09-04 11:23:32 -04:00
packer docs: update scripts to 0.12.4 2020-09-09 15:22:37 -07:00
shared e2e: move configurations into profile-specific directories (#8828) 2020-09-04 11:23:32 -04:00
userdata E2E AMI cleanup (#8697) 2020-08-20 10:09:31 -04:00
.gitignore Infrastructure for Windows e2e testing (#6584) 2019-11-19 11:06:10 -05:00
Makefile e2e: add helper to Makefile for local file deployments (#7822) 2020-04-28 16:15:58 -04:00
README.md e2e: improve provisioning defaults and documentation (#7062) 2020-02-04 10:37:00 -05:00
compute.tf e2e: remove unused EBS volumes and depends_on (#8827) 2020-09-04 10:25:59 -04:00
iam.tf migrate E2E test runs to new AWS account (#8676) 2020-08-18 14:24:34 -04:00
main.tf e2e: minor TF refactor to split out vars and outputs (#8752) 2020-08-26 17:00:36 -04:00
network.tf e2e: add EBS and EFS volumes for testing CSI (#7266) 2020-03-04 10:44:51 -05:00
outputs.tf e2e: minor TF refactor to split out vars and outputs (#8752) 2020-08-26 17:00:36 -04:00
provisioning.tf e2e: move configurations into profile-specific directories (#8828) 2020-09-04 11:23:32 -04:00
terraform.tfvars e2e: improve provisioning defaults and documentation (#7062) 2020-02-04 10:37:00 -05:00
terraform.tfvars.dev fixup! e2e: add a convenient creation script 2020-04-09 11:04:26 -04:00
variables.tf e2e: minor TF refactor to split out vars and outputs (#8752) 2020-08-26 17:00:36 -04:00
versions.tf e2e: upgrade terraform to 0.12.x (#6489) 2019-10-14 11:27:08 -04:00
volumes.tf e2e: have TF write-out HCL for CSI volume registration (#7599) 2020-04-02 12:16:43 -04:00

README.md

Terraform infrastructure

This folder contains terraform resources for provisioning EC2 instances on AWS to use as the target of end-to-end tests.

Terraform provisions the AWS infrastructure only, whereas the Nomad cluster is deployed to that infrastructure by the e2e framework. Terraform's output will include a provisioning stanza that can be written to a JSON file used by the e2e framework's provisioning step.

You can use Terraform to output the provisioning parameter JSON file the e2e framework uses.

Setup

You'll need Terraform 0.12+, as well as AWS credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to create the Nomad cluster. Use envchain to store your AWS credentials.

Optionally, edit the terraform.tfvars file to change the number of Linux clients or Windows clients.

region               = "us-east-1"
instance_type        = "t2.medium"
server_count         = "3"
client_count         = "4"
windows_client_count = "1"

Run Terraform apply to deploy the infrastructure:

cd e2e/terraform/
envchain nomadaws terraform apply

Outputs

After deploying the infrastructure, you can get connection information about the cluster:

  • $(terraform output environment) will set your current shell's NOMAD_ADDR and CONSUL_HTTP_ADDR to point to one of the cluster's server nodes, and set the NOMAD_E2E variable.
  • terraform output servers will output the list of server node IPs.
  • terraform output linux_clients will output the list of Linux client node IPs.
  • terraform output windows_clients will output the list of Windows client node IPs.
  • terraform output provisioning | jq . will output the JSON used by the e2e framework for provisioning.

SSH

You can use Terraform outputs above to access nodes via ssh:

ssh -i keys/nomad-e2e-*.pem ubuntu@${EC2_IP_ADDR}

The Windows client runs OpenSSH for convenience, but has a different user and will drop you into a Powershell shell instead of bash:

ssh -i keys/nomad-e2e-*.pem Administrator@${EC2_IP_ADDR}

Teardown

The terraform state file stores all the info.

cd e2e/terraform/
envchain nomadaws terraform destroy