Skip to content

Commit 148cbd6

Browse files
authored
[Docs] Add example for multiple machine pools (#957)
1 parent 4bae00c commit 148cbd6

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

docs/resources/cluster_v2.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,43 @@ resource "rancher2_machine_config_v2" "foo" {
5858
}
5959
}
6060
61+
# Create a new rancher v2 Cluster with multiple machine pools
62+
resource "rancher2_cluster_v2" "foo-rke2" {
63+
name = "foo-rke2"
64+
kubernetes_version = "<RANCHER_KUBERNETES_VERSION>"
65+
enable_network_policy = false
66+
default_cluster_role_for_project_members = "user"
67+
rke_config {
68+
machine_pools {
69+
name = "pool1"
70+
cloud_credential_secret_name = rancher2_cloud_credential.foo.id
71+
control_plane_role = true
72+
etcd_role = true
73+
worker_role = false
74+
quantity = 1
75+
drain_before_delete = true
76+
machine_config {
77+
kind = rancher2_machine_config_v2.foo.kind
78+
name = rancher2_machine_config_v2.foo.name
79+
}
80+
}
81+
# Each machine pool must be passed separately
82+
machine_pools {
83+
name = "pool2"
84+
cloud_credential_secret_name = rancher2_cloud_credential.foo.id
85+
control_plane_role = false
86+
etcd_role = false
87+
worker_role = true
88+
quantity = 2
89+
drain_before_delete = true
90+
machine_config {
91+
kind = rancher2_machine_config_v2.foo.kind
92+
name = rancher2_machine_config_v2.foo.name
93+
}
94+
}
95+
}
96+
}
97+
6198
# Create a new rancher v2 amazonec2 RKE2 Cluster v2
6299
resource "rancher2_cluster_v2" "foo-rke2" {
63100
name = "foo-rke2"

0 commit comments

Comments
 (0)