diff --git a/README.md b/README.md index f5d0301..81cc5c7 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ To scale the number of nodes up or down, just make sure to properly `kubectl dra For instance: ```tfvars -servers_num = 4 +control_plane_count = 4 agents_num = 3 ``` diff --git a/servers.tf b/servers.tf index 0263f15..9f26677 100644 --- a/servers.tf +++ b/servers.tf @@ -1,7 +1,7 @@ module "control_planes" { source = "./modules/host" - count = var.servers_num + count = var.control_plane_count name = "k3s-control-plane-${count.index}" ssh_keys = [hcloud_ssh_key.k3s.id] @@ -28,7 +28,7 @@ module "control_planes" { } resource "null_resource" "control_planes" { - count = var.servers_num + count = var.control_plane_count triggers = { control_plane_id = module.control_planes[count.index].id diff --git a/terraform.tfvars.example b/terraform.tfvars.example index f3942ce..5ae9930 100644 --- a/terraform.tfvars.example +++ b/terraform.tfvars.example @@ -20,7 +20,7 @@ control_plane_server_type = "cpx11" lb_server_type = "lb11" # At least 3 server nodes is recommended for HA, otherwise you need to turn off automatic upgrade (see ReadMe). -servers_num = 3 +control_plane_count = 3 agent_nodepools = { diff --git a/variables.tf b/variables.tf index 24bb8f1..a0ed062 100644 --- a/variables.tf +++ b/variables.tf @@ -45,6 +45,11 @@ variable "control_plane_server_type" { type = string } +variable "control_plane_count" { + description = "Number of control plane nodes." + type = number +} + variable "lb_server_type" { description = "Default load balancer server type" @@ -57,11 +62,6 @@ variable "lb_disable_ipv6" { default = false } -variable "servers_num" { - description = "Number of control plane nodes." - type = number -} - variable "agent_nodepools" { description = "Number of agent nodes." type = map(any)