diff --git a/platform/main.tf b/platform/main.tf index 191da01a..9bd1d706 100644 --- a/platform/main.tf +++ b/platform/main.tf @@ -3,17 +3,6 @@ provider "rke" { } resource rke_cluster "cluster" { - nodes { - address = "192.168.1.17" - user = "root" - role = [ - "controlplane", - "etcd", - "worker" - ] - ssh_key = file("~/.ssh/id_rsa") - } - dynamic "nodes" { for_each = [ "192.168.1.21", @@ -24,15 +13,30 @@ resource rke_cluster "cluster" { address = nodes.value user = "root" role = [ - "worker", - "etcd" + "controlplane", + "etcd", + "worker" + ] + ssh_key = file("~/.ssh/id_rsa") + } + } + + dynamic "nodes" { + for_each = [ + "192.168.1.17" + ] + content { + address = nodes.value + user = "root" + role = [ + "worker" ] ssh_key = file("~/.ssh/id_rsa") } } } -resource "local_file" "kube_cluster_yaml" { - filename = "${path.root}/kube_config_cluster.yml" +resource "local_file" "kube_config_yaml" { + filename = "${path.root}/kube_config.yaml" content = rke_cluster.cluster.kube_config_yaml }