Skip to content

Commit 81cff34

Browse files
committed
Enable nodegroup taints
1 parent cc667d9 commit 81cff34

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

aws/cluster/modules/eks-node-group/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ resource "aws_eks_node_group" "this" {
3535
AvailabilityZone = each.key
3636
})
3737

38+
dynamic "taint" {
39+
for_each = var.taints
40+
content {
41+
key = taint.value["key"]
42+
value = taint.value["value"]
43+
effect = taint.value["effect"]
44+
}
45+
}
46+
3847
lifecycle {
3948
ignore_changes = [scaling_config[0].desired_size]
4049
}

aws/cluster/modules/eks-node-group/variables.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ variable "subnets" {
4646
description = "Subnets in which the node group should run"
4747
}
4848

49+
variable "taints" {
50+
type = list(object({
51+
key = string
52+
value = optional(string)
53+
effect = string
54+
}))
55+
description = <<-EOT
56+
List of `key`, `value`, `effect` objects representing Kubernetes taints.
57+
`effect` must be one of `NO_SCHEDULE`, `NO_EXECUTE`, or `PREFER_NO_SCHEDULE`.
58+
`key` and `effect` are required, `value` may be null.
59+
EOT
60+
default = []
61+
nullable = false
62+
}
63+
4964
variable "tags" {
5065
type = map(string)
5166
description = "Tags to be applied to created resources"

0 commit comments

Comments
 (0)