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

Select one subnet for AZs where multiple are present and no VPC config provided #6814

Conversation

TiberiuGC
Copy link
Collaborator

@TiberiuGC TiberiuGC commented Jul 14, 2023

Description

Internally, we store subnets as a map, where the key can be either the subnet name of the subnet AZ. As we populate this map when importing a VPC config, if there are multiple subnets in the same availability zone, they will conflict with each other. This happens because, when we find the second subnet, we already have the first one stored by AZ in the map, and the existing validation will see this as a conflict between local state provided in the config file, and the remote state we are trying to import. However, if the user defined this mapping in the config file and chooses to use subnet name as key, the 2 subnets in same AZ won't generate a conflict.

With this PR, we aim to correctly validate config file against remote config, if one is provided. Moreover, if no config file is provided, only one subnet from each AZ will be picked, as this is enforced by the AZSubnetMapping that's being populated using AZs as keys.

Closes #6702

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the userdocs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes
  • (Core team) Added labels for change area (e.g. area/nodegroup) and kind (e.g. kind/improvement)

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@netlify
Copy link

netlify bot commented Jul 14, 2023

Deploy Preview for eksctl canceled.

Name Link
🔨 Latest commit a30eee0
🔍 Latest deploy log https://app.netlify.com/sites/eksctl/deploys/64b4cecb481b1500084ca2a6

@TiberiuGC TiberiuGC marked this pull request as ready for review July 17, 2023 05:29
Copy link
Collaborator

@cPu1 cPu1 left a comment

Choose a reason for hiding this comment

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

I have left a comment about a minor typo but otherwise LGTM.

pkg/apis/eksctl.io/v1alpha5/vpc.go Outdated Show resolved Hide resolved
@TiberiuGC TiberiuGC merged commit 02bd06f into eksctl-io:main Jul 19, 2023
10 checks passed
IdanShohamNetApp pushed a commit to spotinst/weaveworks-eksctl that referenced this pull request Oct 19, 2023
…g provided (eksctl-io#6814)

* Select one subnet for AZs where multiple are present and no VPC config provided

* fix typo

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

Successfully merging this pull request may close these issues.

[Bug] could not import subnet while doing upgrade v0.145.0
2 participants