From 4bedcc50929b0e400f66666f16c76aa11b0c4f3f Mon Sep 17 00:00:00 2001 From: Karim Naufal Date: Wed, 4 May 2022 03:05:39 +0200 Subject: [PATCH] made use of packages_to_install to install open-iscsi for when longhorn is enabled --- agents.tf | 1 + control_planes.tf | 1 + terraform.tfvars.example | 14 +++++++------- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/agents.tf b/agents.tf index fec9eb8..a0c3b45 100644 --- a/agents.tf +++ b/agents.tf @@ -13,6 +13,7 @@ module "agents" { location = each.value.location server_type = each.value.server_type ipv4_subnet_id = hcloud_network_subnet.agent[[for i, v in var.agent_nodepools : i if v.name == each.value.nodepool_name][0]].id + packages_to_install = concat(var.enable_longhorn ? ["open-iscsi"] : [], []) private_ipv4 = cidrhost(hcloud_network_subnet.agent[[for i, v in var.agent_nodepools : i if v.name == each.value.nodepool_name][0]].ip_range, each.value.index + 101) diff --git a/control_planes.tf b/control_planes.tf index 1ca97f2..b7b5c88 100644 --- a/control_planes.tf +++ b/control_planes.tf @@ -13,6 +13,7 @@ module "control_planes" { location = each.value.location server_type = each.value.server_type ipv4_subnet_id = hcloud_network_subnet.control_plane[[for i, v in var.control_plane_nodepools : i if v.name == each.value.nodepool_name][0]].id + packages_to_install = concat(var.enable_longhorn ? ["open-iscsi"] : [], []) # We leave some room so 100 eventual Hetzner LBs that can be created perfectly safely # It leaves the subnet with 254 x 254 - 100 = 64416 IPs to use, so probably enough. diff --git a/terraform.tfvars.example b/terraform.tfvars.example index 2346a51..40bec6d 100644 --- a/terraform.tfvars.example +++ b/terraform.tfvars.example @@ -103,13 +103,13 @@ load_balancer_location = "fsn1" ### The following values are entirely optional -# To use local storage on the nodes, you can enable Longhorn, default is "false" -# enable_longhorn = false +# To use local storage on the nodes, you can enable Longhorn, default is "false". +# enable_longhorn = true -# To disable Hetzner CSI storage, you can set the following to true, default is "false" -# disable_hetzner_csi = false +# To disable Hetzner CSI storage, you can set the following to true, default is "false". +# disable_hetzner_csi = true -# If you want to use a specific Hetzner CCM and CSI version, set them below; otherwise, leave them as-is for the latest versions +# If you want to use a specific Hetzner CCM and CSI version, set them below; otherwise, leave them as-is for the latest versions. # hetzner_ccm_version = "" # hetzner_csi_version = "" @@ -176,8 +176,8 @@ load_balancer_location = "fsn1" # CAVEATS: Calico is not supported for single node setups, because of the following issue https://github.com/k3s-io/klipper-lb/issues/6. # cni_plugin = "calico" -# If you want to disable the k3s default network policy controller, use this flag -# Calico overrides this value to true automatically +# If you want to disable the k3s default network policy controller, use this flag! +# Calico overrides this value to true automatically, the default is "false". # disable_network_policy = true # If you want to disable the automatic use of placement group "spread". See https://docs.hetzner.com/cloud/placement-groups/overview/