From 1491a36a03f8d276165232703185ed53c3690c3e Mon Sep 17 00:00:00 2001 From: "Benjamin P. Jung" Date: Wed, 15 Jul 2020 16:53:44 +0200 Subject: [PATCH] Release v2.0.0. --- CHANGELOG.md | 12 ++++++++++++ README.md | 2 +- main.tf | 26 +++++++++++++++++++++----- variables.tf | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a2c738..153711e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.0] - 2020-07-15 + +This release introduces some breaking changes, because the *default values* of some +of the options have been changed with the introduction of configurable behavior. +Make sure to tune all configurable variables to your needs prior to upgrading to +this new module version. + +### Added + +- Lots of variables have been added to allow changing the behavior of the node + termination handler. + ## [1.2.0] - 2020-07-15 ### Added diff --git a/README.md b/README.md index d6f8f58..e2ef921 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,6 @@ snippet might be used. ```hcl module "aws_node_termination_handler" { source = "iplabs/aws-node-termination-handler/kubernetes" - version = "1.2.0" + version = "2.0.0" } ``` diff --git a/main.tf b/main.tf index 96aeaa6..d9f244a 100644 --- a/main.tf +++ b/main.tf @@ -176,11 +176,11 @@ resource "kubernetes_daemonset" "this" { } env { name = "DELETE_LOCAL_DATA" - value = "false" + value = var.delete_local_data } env { name = "IGNORE_DAEMON_SETS" - value = "false" + value = var.ignore_daemon_sets } env { name = "POD_TERMINATION_GRACE_PERIOD" @@ -212,11 +212,27 @@ resource "kubernetes_daemonset" "this" { } env { name = "ENABLE_SPOT_INTERRUPTION_DRAINING" - value = "" + value = var.enable_spot_interruption_draining } env { - name = "ENABLE_SCHEDULED_DRAINING" - value = "" + name = "ENABLE_SCHEDULED_EVENT_DRAINING" + value = var.enable_scheduled_event_draining + } + env { + name = "METADATA_TRIES" + value = var.metadata_tries + } + env { + name = "CORDON_ONLY" + value = var.cordon_only + } + env { + name = "TAINT_NODE" + value = var.taint_node + } + env { + name = "JSON_LOGGING" + value = var.json_logging } env { name = "ENABLE_PROMETHEUS_SERVER" diff --git a/variables.tf b/variables.tf index a434d90..6f3b1a5 100644 --- a/variables.tf +++ b/variables.tf @@ -4,6 +4,18 @@ variable "node_termination_handler_version" { default = "1.6.1" } +variable "ignore_daemon_sets" { + description = "If true, ignore daemon sets and drain other pods when a spot interrupt is received." + type = bool + default = true +} + +variable "delete_local_data" { + description = "If true, do not drain pods that are using local node storage in emptyDir." + type = bool + default = true +} + variable "node_termination_grace_period" { description = "Period of time in seconds given to each NODE to terminate gracefully. Node draining will be scheduled based on this value to optimize the amount of compute time, but still safely drain the node before an event." type = string @@ -16,6 +28,42 @@ variable "pod_termination_grace_period" { default = "-1" } +variable "enable_scheduled_event_draining" { + description = "If true, drain nodes before the maintenance window starts for an EC2 instance scheduled event." + type = bool + default = false +} + +variable "enable_spot_interruption_draining" { + description = "If true, drain nodes when the spot interruption termination notice is received." + type = bool + default = true +} + +variable "metadata_tries" { + description = "The number of times to try requesting metadata. If you would like 2 retries, set metadata-tries to 3." + type = number + default = 3 +} + +variable "cordon_only" { + description = "If true, nodes will be cordoned but not drained when an interruption event occurs." + type = bool + default = false +} + +variable "taint_node" { + description = "If true, nodes will be tainted when an interruption event occurs." + type = bool + default = false +} + +variable "json_logging" { + description = "If true, use JSON-formatted logs instead of human readable logs." + type = bool + default = false +} + variable "enable_prometheus_server" { description = "Whether to enable a Prometheus endpoint that can be used to gather some metrics." type = bool