-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkers.tf
57 lines (45 loc) · 2 KB
/
workers.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# us_west1_a_2
resource "google_compute_disk" "us_west1_a_2_data" {
provider = google.planktoscope
name = "foundations-us-west1-a-2-data"
type = "pd-standard"
zone = "us-west1-a"
size = 10
disk_encryption_key {
kms_key_self_link = google_kms_crypto_key.disk_planktoscope_global_1_1.id
}
lifecycle {
prevent_destroy = true
}
# After creation, this disk needs to be manually formatted following the instructions at
# https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting
}
module "worker_gcp_us_west1_a_2" {
source = "./modules/gcp-compute-instance"
name = "gcp-us-west1-a-2"
gcp_zone = "us-west1-a"
gcp_machine_type = "e2-small"
gcp_tags = [
"iap-ssh", "zerotier-agent", "nomad-api", "nomad-server", "nomad-client", "http-server",
"http3-server",
]
gcp_boot_disk_image = var.gcp_planktoscope_vm_worker_image
gcp_boot_disk_kms_key_id = google_kms_crypto_key.disk_planktoscope_global_1_1.id
gcp_data_disk_id = google_compute_disk.us_west1_a_2_data.id
gcp_data_disk_kms_key_id = google_compute_disk.us_west1_a_2_data.disk_encryption_key[0].kms_key_self_link
gcp_vpc_subnet_id = module.vpc_subnetwork_planktoscope_gcp_us_west1.gcp_subnetwork_id
zerotier_network_id = module.zerotier_network_foundations.zerotier_network_id
zerotier_ipv4 = "10.144.64.2"
zerotier_ipv6_sixplane = module.zerotier_network_foundations.zerotier_ipv6_sixplane
zerotier_ipv6_rfc4193 = module.zerotier_network_foundations.zerotier_ipv6_rfc4193
dns_infra_domain_name = desec_domain.infra.name
dns_zerotier_network_subname = module.zerotier_network_foundations.name_subname
depends_on = [
google_project_service.compute_planktoscope,
module.vpc_subnetwork_planktoscope_gcp_us_west1
]
providers = {
google = google.planktoscope
}
}
# TODO: add a machine with a "worker" image (i.e. only a Nomad client with a Caddy reverse proxy) to run high-bandwidth/compute services for live.sargassum.world