-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path00-create-k8s-nodes.tf
49 lines (46 loc) · 1.33 KB
/
00-create-k8s-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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
##Setup needed variables
variable "master-count" {}
variable "etcd-count" {}
variable "node-count" {}
variable "internal-ip-pool" {}
variable "image-name" {}
variable "image-flavor" {}
variable "security-groups" {}
variable "key-pair" {}
variable "az" {}
resource "openstack_compute_instance_v2" "master" {
count = "${var.master-count}"
name = "k8s-master-${count.index}"
image_name = "${var.image-name}"
flavor_name = "${var.image-flavor}"
key_pair = "${var.key-pair}"
security_groups = ["${split(",", var.security-groups)}"]
network {
name = "${var.internal-ip-pool}"
}
availability_zone = "${var.az}"
}
resource "openstack_compute_instance_v2" "etcd" {
count = "${var.etcd-count}"
name = "k8s-etcd-${count.index}"
image_name = "${var.image-name}"
flavor_name = "${var.image-flavor}"
key_pair = "${var.key-pair}"
security_groups = ["${split(",", var.security-groups)}"]
network {
name = "${var.internal-ip-pool}"
}
availability_zone = "${var.az}"
}
resource "openstack_compute_instance_v2" "node" {
count = "${var.node-count}"
name = "k8s-node-${count.index}"
image_name = "${var.image-name}"
flavor_name = "${var.image-flavor}"
key_pair = "${var.key-pair}"
security_groups = ["${split(",", var.security-groups)}"]
network {
name = "${var.internal-ip-pool}"
}
availability_zone = "${var.az}"
}