-
Notifications
You must be signed in to change notification settings - Fork 1
/
02-master-nodes.tf
29 lines (26 loc) · 928 Bytes
/
02-master-nodes.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
resource "packet_reserved_ip_block" "cluster_ip" {
project_id = "${packet_project.new_project.id}"
facility = "${var.facility}"
quantity = 1
}
data "template_file" "master_user_data" {
template = "${file("templates/master_user_data.sh")}"
vars = {
message = "Hello world!"
}
}
resource "packet_device" "k8s_masters" {
count = "${var.master_count}"
hostname = "${format("%s-master%02d", var.cluster_name, count.index + 1)}"
plan = "${var.master_size}"
facilities = ["${var.facility}"]
operating_system = "${var.k8s_os}"
billing_cycle = "${var.billing_cycle}"
project_id = "${packet_project.new_project.id}"
user_data = "${data.template_file.master_user_data.rendered}"
}
resource "packet_bgp_session" "master_bgp_session" {
count = "${var.master_count}"
device_id = "${element(packet_device.k8s_masters.*.id, count.index)}"
address_family = "ipv4"
}