Change kube config file name

This commit is contained in:
Khue Doan 2020-11-05 01:09:18 +07:00
parent cda886384e
commit 6066cd7728

View File

@ -3,17 +3,6 @@ provider "rke" {
} }
resource rke_cluster "cluster" { resource rke_cluster "cluster" {
nodes {
address = "192.168.1.17"
user = "root"
role = [
"controlplane",
"etcd",
"worker"
]
ssh_key = file("~/.ssh/id_rsa")
}
dynamic "nodes" { dynamic "nodes" {
for_each = [ for_each = [
"192.168.1.21", "192.168.1.21",
@ -24,15 +13,30 @@ resource rke_cluster "cluster" {
address = nodes.value address = nodes.value
user = "root" user = "root"
role = [ role = [
"worker", "controlplane",
"etcd" "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") ssh_key = file("~/.ssh/id_rsa")
} }
} }
} }
resource "local_file" "kube_cluster_yaml" { resource "local_file" "kube_config_yaml" {
filename = "${path.root}/kube_config_cluster.yml" filename = "${path.root}/kube_config.yaml"
content = rke_cluster.cluster.kube_config_yaml content = rke_cluster.cluster.kube_config_yaml
} }