Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Supporting update_config in EKS managed node groups #1560

Merged
merged 6 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,17 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.40.0 |
| <a name="provider_http"></a> [http](#provider\_http) | >= 2.4.1 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 1.11.1 |
| <a name="provider_local"></a> [local](#provider\_local) | >= 1.4 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.56.0 |
| <a name="provider_http"></a> [http](#provider\_http) | 2.4.1 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | 2.4.1 |
| <a name="provider_local"></a> [local](#provider\_local) | 2.1.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_fargate"></a> [fargate](#module\_fargate) | ./modules/fargate | |
| <a name="module_node_groups"></a> [node\_groups](#module\_node\_groups) | ./modules/node_groups | |
| <a name="module_fargate"></a> [fargate](#module\_fargate) | ./modules/fargate | n/a |
| <a name="module_node_groups"></a> [node\_groups](#module\_node\_groups) | ./modules/node_groups | n/a |

## Resources

Expand Down
3 changes: 3 additions & 0 deletions examples/managed_node_groups/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ module "eks" {
effect = "NO_SCHEDULE"
}
]
update_config = {
max_unavailable_percentage = 50
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/fargate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Helper submodule to create and manage resources related to `aws_eks_fargate_prof

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.40.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.56.0 |

## Modules

Expand Down
6 changes: 4 additions & 2 deletions modules/node_groups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
| launch\_template_version | The version of the LT to use | string | none |
| max\_capacity | Max number of workers | number | `var.workers_group_defaults[asg_max_size]` |
| min\_capacity | Min number of workers | number | `var.workers_group_defaults[asg_min_size]` |
| update_config.max\_unavailable\_percentage | Max percentage of unavailable nodes during update. (e.g. 25, 50, etc) | number | not used |
| update_config.max\_unavailable | Max number of unavailable nodes during update | number | `null` if `update_config.max_unavailable_percentage` is set, `1` otherwise |
| name | Name of the node group. If you don't really need this, we recommend you to use `name_prefix` instead. | string | Will use the autogenerate name prefix |
| name_prefix | Name prefix of the node group | string | Auto generated |
| pre_userdata | userdata to pre-append to the default userdata. Require `create_launch_template` to be `true`| string | "" |
Expand All @@ -62,8 +64,8 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.43.0 |
| <a name="provider_cloudinit"></a> [cloudinit](#provider\_cloudinit) | n/a |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.56.0 |
| <a name="provider_cloudinit"></a> [cloudinit](#provider\_cloudinit) | 2.2.0 |

## Modules

Expand Down
1 change: 1 addition & 0 deletions modules/node_groups/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ locals {
taints = []
update_default_version = true
ebs_optimized = null
update_config = tomap({ "max_unavailable" : 1 })
antonbabenko marked this conversation as resolved.
Show resolved Hide resolved
},
var.node_groups_defaults,
v,
Expand Down
5 changes: 5 additions & 0 deletions modules/node_groups/node_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ resource "aws_eks_node_group" "workers" {
}
}

update_config {
max_unavailable_percentage = lookup(each.value.update_config, "max_unavailable_percentage", null)
max_unavailable = lookup(each.value.update_config, "max_unavailable", null)
}

version = lookup(each.value, "version", null)

labels = merge(
Expand Down