-
Notifications
You must be signed in to change notification settings - Fork 5
/
ec2cluster.tf
35 lines (33 loc) · 922 Bytes
/
ec2cluster.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
resource "rancher2_cluster" "ec2_cluster" {
name = "ec2-cluster"
description = "Rancher EC2 Cluster"
rke_config {
network {
plugin = "canal"
}
upgrade_strategy {
drain = true
max_unavailable_worker = "20%"
}
}
}
resource "rancher2_node_pool" "control_plane_pool" {
cluster_id = rancher2_cluster.ec2_cluster.id
name = "control-plane"
hostname_prefix = "cp-"
node_template_id = rancher2_node_template.control_plane.id
quantity = 3
control_plane = true
etcd = true
worker = false
}
resource "rancher2_node_pool" "worker_pool" {
cluster_id = rancher2_cluster.ec2_cluster.id
name = "worker-nodes"
hostname_prefix = "worker-"
node_template_id = rancher2_node_template.worker.id
quantity = 3
control_plane = false
etcd = false
worker = true
}