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: Allow override of timeouts in node_groups #1552

Merged
merged 10 commits into from
Sep 3, 2021

Conversation

RobertKozak
Copy link
Contributor

PR o'clock

Description

This allows timeouts to be configured for aws_eks_node_group using the standard timeout block.

Updating node groups with large nodes often takes more than the default 1 hour and terraform can time out.

This pull request handles this by allowing you to add a timeout block to either the node_groups_defaults or to individual node_groups.

This PR also respects the timeouts described here

NOTE: You can set either / or create, update, delete and you will get defaults for the ones not supplied

There are a couple other PRs for this same issue #1173 but one PR #1209 is very old with no changes since Jan 30 and the other PR #1467 is just too simplistic for a long term solution.

Linked PRs and Issues

Checklist

@@ -69,6 +69,12 @@ resource "aws_eks_node_group" "workers" {
}
}

timeouts {
create = lookup(each.value["timeouts"], "create", "60m")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the fallback on all of these, can we use null so that we use whats provided by the upstream provider (looks like it defaults to an hour https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group#timeouts )

Suggested change
create = lookup(each.value["timeouts"], "create", "60m")
create = lookup(each.value["timeouts"], "create", null)
update = lookup(each.value["timeouts"], "update", null)
delete = lookup(each.value["timeouts"], "delete", null)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try that. When I was doing my testing it didn't actually fallback and created empty values that broke the plan. But I will try again.

@bryantbiggs
Copy link
Member

actually, looks like theres a bit more - I think what is captured in this PR is what we are looking for #1209

if you update with those changes we can get this merged

@RobertKozak
Copy link
Contributor Author

I'll try again and get this updated after some testing on my end

@RobertKozak
Copy link
Contributor Author

@bryantbiggs OK. all checked in and ready

Copy link
Contributor

@daroga0002 daroga0002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@antonbabenko antonbabenko changed the title feat: Override timeouts in node_groups feat: Allow override of timeouts in node_groups Sep 3, 2021
@antonbabenko antonbabenko merged commit b7413b3 into terraform-aws-modules:master Sep 3, 2021
@antonbabenko
Copy link
Member

Thanks @RobertKozak !

v17.9.0 has been just released.

@@ -96,6 +96,7 @@ locals {
additional_ebs_volumes = [] # A list of additional volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), volume_size, volume_type, iops, throughput, encrypted, kms_key_id (only on launch-template), delete_on_termination. Optional values are grabbed from root volume or from defaults
additional_instance_store_volumes = [] # A list of additional instance store (local disk) volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), virtual_name.
warm_pool = null # If this block is configured, add a Warm Pool to the specified Auto Scaling group.
timeouts = {} # A map of timeouts for create/update/delete operations
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this have been:
timeouts = var.timeouts

The timeouts variable in the variable.tf file does not seem to actually be used during my testing

@csschwe
Copy link

csschwe commented Sep 21, 2021

This merge was basically reverted by #1583

@daroga0002
Copy link
Contributor

This merge was basically reverted by #1583

I still see this https://github.com/RobertKozak/terraform-aws-eks/blob/d46c49562771f247bf012031337968aef616332b/modules/node_groups/locals.tf#L27

so this feature is still available

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants