-
Notifications
You must be signed in to change notification settings - Fork 0
/
workers.tf
63 lines (50 loc) · 1.56 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
58
59
60
61
62
63
resource "google_compute_instance" "worker_minhpvt" {
name = "worker-minhpvt-${count.index}"
count = 0
provider = google.minhpvt
machine_type = "e2-custom-2-8192" # 2 vCPUs, 8 GB memory
boot_disk {
auto_delete = true
device_name = "efiss"
initialize_params {
image = "projects/debian-cloud/global/images/debian-11-bullseye-v20230711"
size = 80
type = "pd-balanced"
}
mode = "READ_WRITE"
}
can_ip_forward = false
deletion_protection = false
enable_display = false
labels = {
goog-ec-src = "vm_add-tf"
type = "worker"
}
metadata = {
ssh-keys = file("./ssh-keys.txt")
startup-script = "curl -s https://raw.githubusercontent.com/EFISS-Capstone-SU23/k8s-manifest/main/scripts/gcp-scripts/gce-worker-setup.sh | bash -s ${var.worker_join_token} ${var.worker_join_hash_discover}"
}
network_interface {
access_config {
network_tier = "PREMIUM"
}
subnetwork = "projects/impactful-bee-400715/regions/${var.region}/subnetworks/default"
}
scheduling {
automatic_restart = true
on_host_maintenance = "MIGRATE"
preemptible = false
provisioning_model = "STANDARD"
}
service_account {
email = "[email protected]"
scopes = ["https://www.googleapis.com/auth/cloud-platform"]
}
shielded_instance_config {
enable_integrity_monitoring = true
enable_secure_boot = false
enable_vtpm = true
}
tags = ["http-server", "https-server"]
zone = var.zone
}