Skip to content

Commit bf9ed60

Browse files
committed
Add support for node_groups taints
1 parent bf4fd83 commit bf9ed60

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

examples/managed_node_groups/main.tf

+7
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ module "eks" {
8888
additional_tags = {
8989
ExtraTag = "example"
9090
}
91+
taints = [
92+
{
93+
key = "dedicated"
94+
value = "gpuGroup"
95+
effect = "NO_SCHEDULE"
96+
}
97+
]
9198
}
9299
}
93100

modules/node_groups/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,21 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
4444
| source\_security\_group\_ids | Source security groups for remote access to workers | list(string) | If key\_name is specified: THE REMOTE ACCESS WILL BE OPENED TO THE WORLD |
4545
| subnets | Subnets to contain workers | list(string) | `var.workers_group_defaults[subnets]` |
4646
| version | Kubernetes version | string | Provider default behavior |
47+
| taints | Kubernetes node taints | list(map) | empty |
4748

4849
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4950
## Requirements
5051

5152
| Name | Version |
5253
|------|---------|
5354
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
54-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.40.0 |
55+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.43.0 |
5556

5657
## Providers
5758

5859
| Name | Version |
5960
|------|---------|
60-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.40.0 |
61+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.43.0 |
6162
| <a name="provider_cloudinit"></a> [cloudinit](#provider\_cloudinit) | n/a |
6263

6364
## Modules

modules/node_groups/node_groups.tf

+10
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ resource "aws_eks_node_group" "workers" {
5757
}
5858
}
5959

60+
dynamic "taint" {
61+
for_each = each.value["taints"] == null ? [] : each.value["taints"]
62+
63+
content {
64+
key = taint.value["key"]
65+
value = taint.value["value"]
66+
effect = taint.value["effect"]
67+
}
68+
}
69+
6070
version = lookup(each.value, "version", null)
6171

6272
labels = merge(

modules/node_groups/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ terraform {
22
required_version = ">= 0.13.1"
33

44
required_providers {
5-
aws = ">= 3.40.0"
5+
aws = ">= 3.43.0"
66
}
77
}

0 commit comments

Comments
 (0)