mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-05 13:08:52 +07:00
39 lines
677 B
HCL
39 lines
677 B
HCL
provider "rke" {
|
|
debug = true
|
|
}
|
|
|
|
resource rke_cluster "cluster" {
|
|
nodes {
|
|
address = "192.168.1.21"
|
|
user = "root"
|
|
role = [
|
|
"controlplane",
|
|
"etcd",
|
|
"worker"
|
|
]
|
|
ssh_key = file("~/.ssh/id_rsa")
|
|
}
|
|
|
|
dynamic "nodes" {
|
|
for_each = [
|
|
"192.168.1.17",
|
|
"192.168.1.22",
|
|
"192.168.1.23"
|
|
]
|
|
content {
|
|
address = nodes.value
|
|
user = "root"
|
|
role = [
|
|
"worker",
|
|
"etcd"
|
|
]
|
|
ssh_key = file("~/.ssh/id_rsa")
|
|
}
|
|
}
|
|
}
|
|
|
|
resource "local_file" "kube_cluster_yaml" {
|
|
filename = "${path.root}/kube_config_cluster.yml"
|
|
content = rke_cluster.cluster.kube_config_yaml
|
|
}
|