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

Least Populated Subnet #489

Merged
merged 1 commit into from
Apr 30, 2020
Merged

Conversation

bdwyertech
Copy link
Contributor

@bdwyertech bdwyertech commented Apr 23, 2020

Select the least-populated subnet if we have multiple matches -- previously we just took the first match.

VPC may span multiple regions -- subnets are region specific. This lets you pick the least populated VPC.

This should help to distribute the test-kitchen load more evenly across multi-az VPC's while maintaining full backward compatibility.

We've noticed intermittent problems internally with our cookbook generator where folks do not change the default (e.g. org_*_dmz => always resolves to org_us-east-1a-dmz). Kitchens sometimes fail either because of spot instance unavailability, ip starvation, etc.

@sumitag @chefbob @danielcbright

@bdwyertech bdwyertech force-pushed the least-populated-subnet branch 6 times, most recently from 2c480e3 to 951f2aa Compare April 23, 2020 04:46
@bdwyertech bdwyertech force-pushed the least-populated-subnet branch from 951f2aa to 6d646b3 Compare April 23, 2020 04:52
@bdwyertech
Copy link
Contributor Author

bdwyertech commented Apr 23, 2020

The driver also uses similar logic over here to create a security group if one is not supplied:

subnets.first.vpc_id

I could not for the life of me figure out how to mock the following in RSpec:

subnet = subnets.sort_by { |s| s[:available_ip_address_count] }.last.vpc_id

@chefbob
Copy link

chefbob commented Apr 23, 2020

Nice. Thanks for putting this together. Definitely would come in handy.

@tas50 tas50 merged commit f02499a into test-kitchen:master Apr 30, 2020
@tas50
Copy link
Member

tas50 commented Apr 30, 2020

Nice little addition there. Thanks @bdwyertech

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants