forked from rancher/terraform-provider-rke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrke.tf
40 lines (37 loc) · 1023 Bytes
/
rke.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
module "nodes" {
source = "./do"
# region = "nyc1"
# droplet_size = "t2.micro"
}
resource rke_cluster "cluster" {
nodes = [
{
address = "${module.nodes.addresses[0]}"
user = "${module.nodes.ssh_username}"
ssh_key = "${module.nodes.private_key}"
role = ["controlplane", "etcd"]
},
{
address = "${module.nodes.addresses[1]}"
user = "${module.nodes.ssh_username}"
ssh_key = "${module.nodes.private_key}"
role = ["worker"]
},
{
address = "${module.nodes.addresses[2]}"
user = "${module.nodes.ssh_username}"
ssh_key = "${module.nodes.private_key}"
role = ["worker"]
},
{
address = "${module.nodes.addresses[3]}"
user = "${module.nodes.ssh_username}"
ssh_key = "${module.nodes.private_key}"
role = ["worker"]
},
]
}
resource "local_file" "kube_cluster_yaml" {
filename = "./kube_config_cluster.yml"
content = "${rke_cluster.cluster.kube_config_yaml}"
}