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" {
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
}