From be1c4efefb9923358f2b4af45bc13dd1b62e9a61 Mon Sep 17 00:00:00 2001 From: Karim Naufal Date: Wed, 9 Mar 2022 03:43:10 +0100 Subject: [PATCH] tweaked single node setup --- locals.tf | 2 +- terraform.tfvars.example | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/locals.tf b/locals.tf index 13ea3db..8b08485 100644 --- a/locals.tf +++ b/locals.tf @@ -1,6 +1,6 @@ locals { # if we are in a single cluster config, we use the default klipper lb instead of Hetzner LB - is_single_node_cluster = var.control_plane_count + length(var.agent_nodepools) == 1 + is_single_node_cluster = var.control_plane_count + sum(concat([for v in var.agent_nodepools : v.count], [0])) == 1 ssh_public_key = trimspace(file(var.public_key)) # ssh_private_key is either the contents of var.private_key or null to use a ssh agent. ssh_private_key = var.private_key == null ? null : trimspace(file(var.private_key)) diff --git a/terraform.tfvars.example b/terraform.tfvars.example index 9484d24..b7310ad 100644 --- a/terraform.tfvars.example +++ b/terraform.tfvars.example @@ -28,7 +28,7 @@ control_plane_server_type = "cpx11" # As for the agent nodepools, below is just an example, if you do not want nodepools, just use one, # and change the name to what you want, it need not be "agent-big" or "agent-small", also give them the subnet prefer. -# For single node clusters set this equal to [] or just set the counts to 0 +# For single node clusters set this equal to [] or just set the counts to 0. # IMPORTANT: Once the cluster is created, you can change the count, and even set it to 0, but do not remove a nodepool from the list. # You can add others at the end of the list if you want. agent_nodepools = [