Skip to content

Commit

Permalink
Release v2.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin P. Jung committed Jul 15, 2020
1 parent c6d661c commit 1491a36
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 6 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
```
26 changes: 21 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
48 changes: 48 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1491a36

Please sign in to comment.