From 31924b1038fb7bdfcc8e0673ac542c799168174f Mon Sep 17 00:00:00 2001 From: Karim Naufal Date: Tue, 22 Mar 2022 11:47:51 +0100 Subject: [PATCH] disable flags tweak --- control_planes.tf | 2 +- init.tf | 2 +- locals.tf | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/control_planes.tf b/control_planes.tf index 8398117..d39047f 100644 --- a/control_planes.tf +++ b/control_planes.tf @@ -48,7 +48,7 @@ resource "null_resource" "control_planes" { server = "https://${element(module.control_planes.*.private_ipv4_address, count.index > 0 ? 0 : 1)}:6443" token = random_password.k3s_token.result disable-cloud-controller = true - disable = ["servicelb", "local-storage", "traefik", "metric-server"] + disable = local.disable_extras flannel-iface = "eth1" kubelet-arg = "cloud-provider=external" node-ip = module.control_planes[count.index].private_ipv4_address diff --git a/init.tf b/init.tf index f50341b..1e8eb7e 100644 --- a/init.tf +++ b/init.tf @@ -13,7 +13,7 @@ resource "null_resource" "first_control_plane" { token = random_password.k3s_token.result cluster-init = true disable-cloud-controller = true - disable = concat(["local-storage"], local.is_single_node_cluster ? [] : ["servicelb"], var.traefik_enabled ? [] : ["traefik"], var.metrics_server_enabled ? [] : ["metrics-server"]) + disable = local.disable_extras flannel-iface = "eth1" kubelet-arg = "cloud-provider=external" node-ip = module.control_planes[0].private_ipv4_address diff --git a/locals.tf b/locals.tf index 8b08485..95daf55 100644 --- a/locals.tf +++ b/locals.tf @@ -186,4 +186,8 @@ locals { # The first two subnets are respectively the default subnet 10.0.0.0/16 use for potientially anything and 10.1.0.0/16 used for control plane nodes. # the rest of the subnets are for agent nodes in each nodepools. network_ipv4_subnets = [for index in range(length(var.agent_nodepools) + 2) : cidrsubnet(local.network_ipv4_cidr, 8, index)] + + # disable k3s extras + disable_extras = concat(["local-storage"], local.is_single_node_cluster ? [] : ["servicelb"], var.traefik_enabled ? [] : ["traefik"], var.metrics_server_enabled ? [] : ["metrics-server"]) + }