-
Notifications
You must be signed in to change notification settings - Fork 0
/
servers.tf
50 lines (46 loc) · 1.08 KB
/
servers.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
resource "hcloud_server" "kube-master" {
name = "kube-master${count.index}"
image = var.os_type
server_type = var.server_type
location = var.location
ssh_keys = [hcloud_ssh_key.mykey.id]
count = var.instances
labels = {
type = "master"
ansible-group = "master_servers"
}
network {
network_id = hcloud_network.hc_private.id
}
user_data = file("user_data.yml")
public_net {
ipv4_enabled = true
ipv6_enabled = false
}
depends_on = [
hcloud_network_subnet.hc_private_subnet
]
}
resource "hcloud_server" "kube-worker" {
name = "kube-worker${count.index}"
image = var.os_type
server_type = var.server_type
location = var.location
ssh_keys = [hcloud_ssh_key.mykey.id]
count = var.instances
labels = {
type = "worker"
ansible-group = "worker_servers"
}
network {
network_id = hcloud_network.hc_private.id
}
user_data = file("user_data.yml")
public_net {
ipv4_enabled = true
ipv6_enabled = false
}
depends_on = [
hcloud_network_subnet.hc_private_subnet
]
}