-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompute_instances.tf
More file actions
61 lines (51 loc) · 1.47 KB
/
compute_instances.tf
File metadata and controls
61 lines (51 loc) · 1.47 KB
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
resource "google_compute_instance" "controller" {
count = 3
name = "controller-${count.index}"
machine_type = "e2-standard-2"
can_ip_forward = true
tags = ["kubernetes-dev", "controller"]
boot_disk {
initialize_params {
size = 200
image = "ubuntu-os-cloud/ubuntu-2004-lts"
}
}
network_interface {
network = "kubernetes-dev"
subnetwork = "kubernetes"
network_ip = "10.240.0.1${count.index}"
access_config {
// Ephemeral public IP, if omitted instances can't be accessed via the Internet.
}
}
service_account {
scopes = ["compute-rw", "storage-ro", "service-management", "service-control", "logging-write", "monitoring"]
}
}
resource "google_compute_instance" "worker" {
count = 3
name = "worker-${count.index}"
machine_type = "e2-standard-2"
can_ip_forward = true
tags = ["kubernetes-dev", "worker"]
metadata = {
pod-cidr = "10.200.${count.index}.0/24"
}
boot_disk {
initialize_params {
size = 200
image = "ubuntu-os-cloud/ubuntu-2004-lts"
}
}
network_interface {
network = "kubernetes-dev"
subnetwork = "kubernetes"
network_ip = "10.240.0.2${count.index}"
access_config {
// Ephemeral public IP, if omitted instances can't be accessed via the Internet.
}
}
service_account {
scopes = ["compute-rw", "storage-ro", "service-management", "service-control", "logging-write", "monitoring"]
}
}