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

Fix desired size of eks node group #94

Merged
merged 1 commit into from
Jan 17, 2023
Merged

Fix desired size of eks node group #94

merged 1 commit into from
Jan 17, 2023

Conversation

maxsxu
Copy link
Member

@maxsxu maxsxu commented Jan 16, 2023

Motivation

Encountering error "invalid desiredSize" while applying with below input variables:

node_pool_min_size = 1
node_pool_max_size = 12
node_pool_desired_size = 1
node_pool_instance_types = ["c6i.2xlarge"]

That's caused by the computed desired size via node_pool_instance_types could be 0., which violates the rule "Desired number of nodes should not be lower than the minimum number of nodes that the group can scale out to."

Actually the desired_size has already been assigned in its above code block node_group_defaults:

desired_size = var.node_pool_desired_size

We should just respect it.

Modifications

  • Remove the duplicated desired_size assignment line

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Documentation

  • no-need-doc

Desired number of nodes should not be lower than the minimum number of nodes that the group can scale out to.

Signed-off-by: Max Xu <[email protected]>
@maxsxu maxsxu self-assigned this Jan 16, 2023
@maxsxu maxsxu requested a review from a team as a code owner January 16, 2023 09:03
@github-actions github-actions bot added the no-need-doc This pr does not need any document label Jan 16, 2023
Copy link
Contributor

@ignacioli ignacioli left a comment

Choose a reason for hiding this comment

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

LGTM

@gengmao
Copy link
Contributor

gengmao commented Jan 16, 2023

Can node_pool_min_size be 0? New terraform code create one pool per instance type and subnet. Will it cause waste?

@maxsxu
Copy link
Member Author

maxsxu commented Jan 17, 2023

Can node_pool_min_size be 0?

Yes. The scaling config rules for a node group according to https://docs.aws.amazon.com/eks/latest/APIReference/API_NodegroupScalingConfig.html:

  • minSize $\ge$ 0
  • maxSize $\ge$ 1
  • desiredSize $\ge$ 0
  • minSize $\le$ desiredSize $\le$ maxSize

New terraform code create one pool per instance type and subnet. Will it cause waste?

IMO, It should be ok, as we can specify the node_pool_max_size so the node group autoscaling will take care of the number of real EC2 instances.

@maxsxu maxsxu merged commit 9de01d2 into master Jan 17, 2023
@delete-merged-branch delete-merged-branch bot deleted the max/fix branch January 17, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-need-doc This pr does not need any document
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants