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: support custom subnet ID (--vnet-subnet-id) #238

Merged
merged 26 commits into from
Apr 6, 2024

Conversation

Bryce-Soghigian
Copy link
Collaborator

@Bryce-Soghigian Bryce-Soghigian commented Mar 29, 2024

Fixes #199

Description
This pr solves the issue linked above and allows karpenter to tap into a specifed custom vnet + subnet id, via --vnet-subnet-id global flag. Both self-hosted and NAP deployments are expected to populate this from custom subnet specified for the cluster, which can be looked up from the system nodepool.

How was this change tested?

  • ran make az-all-custom-subnet with new custom vnet cluster create:
  • ran make az-perftest100 took 3 minutes to create all 100 nodes, they all join the subnet fine

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

Release Note

Support custom subnet ID via `--vnet-subnet-id` flag

@Bryce-Soghigian Bryce-Soghigian added kind/feature Categorizes issue or PR as related to a new feature. area/networking Issues or PRs related to networking labels Mar 29, 2024
@Bryce-Soghigian Bryce-Soghigian self-assigned this Mar 29, 2024
@coveralls
Copy link

coveralls commented Mar 29, 2024

Pull Request Test Coverage Report for Build 8577118060

Details

  • 76 of 82 (92.68%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 97.761%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/providers/launchtemplate/launchtemplate.go 28 34 82.35%
Totals Coverage Status
Change from base Build 8575878262: 0.04%
Covered Lines: 35672
Relevant Lines: 36489

💛 - Coveralls

Copy link
Collaborator Author

@Bryce-Soghigian Bryce-Soghigian left a comment

Choose a reason for hiding this comment

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

/test

@tallaxes
Copy link
Collaborator

tallaxes commented Mar 30, 2024

Here is another place where subnet id is used (currently hardcoded, would need to change):


Now, I strongly suspect that on the node this affects only azure.json, and I can't think of why this would actually be needed. If this is indeed unused, it (quite possibly with some other fields) would be a prime candidate for removing from the contract. (This is very much related to contract discussion here Azure/AgentBaker#4208 (comment), cc @lilypan26)

@Bryce-Soghigian
Copy link
Collaborator Author

Here is another place where subnet id is used (currently hardcoded, would need to change):

Fixed this

Copy link
Collaborator Author

@Bryce-Soghigian Bryce-Soghigian left a comment

Choose a reason for hiding this comment

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

/test

@Bryce-Soghigian
Copy link
Collaborator Author

Bryce-Soghigian commented Mar 30, 2024

As a result of moving most of the refactoring into this pr, the subnet per nodeclass pr became much smaller: #243

 Please enter the commit message for your changes. Lines starting
@Bryce-Soghigian Bryce-Soghigian force-pushed the bsoghigian/stage-0-custom-vnet-rg branch from 5179ee9 to 5392c8f Compare March 30, 2024 19:02
Copy link
Collaborator

@tallaxes tallaxes left a comment

Choose a reason for hiding this comment

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

Left some comments. The main thing is likely re using options rather than client config for subnet id (apologies for not catching this earlier)

Copy link
Collaborator

@tallaxes tallaxes left a comment

Choose a reason for hiding this comment

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

BTW, where did the creation of cluster with custom subnet go? Or az-all-custom-subnet (mentioned in description)?

@Bryce-Soghigian
Copy link
Collaborator Author

BTW, where did the creation of cluster with custom subnet go? Or az-all-custom-subnet (mentioned in description)?

I screwed up the rebase maybe idk where it went

@Bryce-Soghigian Bryce-Soghigian requested a review from tallaxes April 1, 2024 02:33
Copy link
Collaborator Author

@Bryce-Soghigian Bryce-Soghigian left a comment

Choose a reason for hiding this comment

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

/test

@Bryce-Soghigian Bryce-Soghigian requested a review from tallaxes April 4, 2024 23:22
@Bryce-Soghigian Bryce-Soghigian requested a review from tallaxes April 5, 2024 17:17
Copy link
Collaborator Author

@Bryce-Soghigian Bryce-Soghigian left a comment

Choose a reason for hiding this comment

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

/test

tallaxes
tallaxes previously approved these changes Apr 5, 2024
Copy link
Collaborator

@tallaxes tallaxes left a comment

Choose a reason for hiding this comment

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

LGTM, pending test success. Thanks for all the fixes!

Copy link
Collaborator

@tallaxes tallaxes left a comment

Choose a reason for hiding this comment

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

Approved, conditional on passing tests

Copy link
Collaborator

@tallaxes tallaxes left a comment

Choose a reason for hiding this comment

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

/test

@tallaxes tallaxes changed the title feat: karpenter will now respect the --vnet-subnet-id set on the systempool during cluster create feat: support custom subnet ID (--vnet-subnet-id) Apr 6, 2024
@Bryce-Soghigian Bryce-Soghigian merged commit 02b76c6 into main Apr 6, 2024
18 checks passed
@Bryce-Soghigian Bryce-Soghigian deleted the bsoghigian/stage-0-custom-vnet-rg branch April 6, 2024 01:22
Copy link
Collaborator

@tallaxes tallaxes left a comment

Choose a reason for hiding this comment

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

Further testing showed some custom VNet related targets have issues, fixing in #148 (as it changes the flow anyway ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking Issues or PRs related to networking kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BYO Custom VNET
3 participants