mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-05 13:08:52 +07:00
Change kube config file name
This commit is contained in:
parent
cda886384e
commit
6066cd7728
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user