From cd4d39afaa26b1df989caa71e1aa183e08f3bcd7 Mon Sep 17 00:00:00 2001 From: Peter Svensson Date: Mon, 13 Jun 2022 15:42:35 +0200 Subject: [PATCH] chore: add variables for rebalancing --- k8s.tf | 4 ++-- vars.tf | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/k8s.tf b/k8s.tf index 961da6f..7623739 100644 --- a/k8s.tf +++ b/k8s.tf @@ -173,8 +173,8 @@ resource "kops_cluster" "k8s" { enabled = true enable_sqs_termination_draining = var.node_termination_handler_sqs managed_asg_tag = var.node_termination_handler_sqs ? "aws-node-termination-handler/managed" : null - enable_rebalance_draining = true - enable_rebalance_monitoring = true + enable_rebalance_draining = var.enable_rebalance_draining + enable_rebalance_monitoring = var.enable_rebalance_monitoring } service_account_issuer_discovery { diff --git a/vars.tf b/vars.tf index 4f6a9da..f02974b 100644 --- a/vars.tf +++ b/vars.tf @@ -165,6 +165,18 @@ variable "node_termination_handler_sqs" { description = "Use SQS for Node Termination Handler draining" } +variable "enable_rebalance_draining" { + type = bool + default = false + description = "Whether node termination handler drain nodes when the re-balance recommendation notice is received or not" +} + +variable "enable_rebalance_monitoring" { + type = bool + default = false + description = "Whether node termination handler cordon nodes when the re-balance recommendation notice is received or not" +} + variable "docker_config" { type = string default = "{}"