-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Feature alb subnets #3437
Feature alb subnets #3437
Conversation
Hi @jerryhe1999. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
pkg/networking/subnet_resolver.go
Outdated
@@ -48,6 +48,8 @@ type SubnetsResolveOptions struct { | |||
AvailableIPAddressCount int64 | |||
// whether to check the cluster tag | |||
SubnetsClusterTagCheck bool | |||
// Disable subnet minimal count restriction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe reword: whether to allow using only 1 subnet for provisioning ALB, default to false
pkg/networking/subnet_resolver.go
Outdated
@@ -95,6 +97,13 @@ func WithSubnetsClusterTagCheck(SubnetsClusterTagCheck bool) SubnetsResolveOptio | |||
} | |||
} | |||
|
|||
// WithALBSingleSubnet generate an option that foncigure ALBSingleSubnet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: foncigure or configure?
Thanks for the contribution. Please also add:
|
pkg/networking/subnet_resolver.go
Outdated
@@ -364,6 +373,9 @@ func (r *defaultSubnetsResolver) validateSubnetsMinimalCount(subnets []*ec2sdk.S | |||
// computeSubnetsMinimalCount returns the minimal count requirement for subnets. | |||
func (r *defaultSubnetsResolver) computeSubnetsMinimalCount(subnetLocale subnetLocaleType, resolveOpts SubnetsResolveOptions) int { | |||
minimalCount := 1 | |||
if resolveOpts.ALBSingleSubnet && resolveOpts.LBType == elbv2model.LoadBalancerTypeApplication { | |||
return minimalCount | |||
} | |||
if resolveOpts.LBType == elbv2model.LoadBalancerTypeApplication && subnetLocale == subnetLocaleTypeAvailabilityZone { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be much more straightforward as:
if resolveOpts.LBType == elbv2model.LoadBalancerTypeApplication && subnetLocale == subnetLocaleTypeAvailabilityZone { | |
if resolveOpts.LBType == elbv2model.LoadBalancerTypeApplication && subnetLocale == subnetLocaleTypeAvailabilityZone && !resolveOpts.ALBSingleSubnet { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing @johngmyers, the change has been made and submitted.
Is there any particular reason this needs to be feature-flagged? |
To answer my own question, I think this is so that LBC can give better and earlier error messages in the common case where the ALB service requires a minimum of 2. |
@johngmyers, it's an opt-in feature from ELB side. They are working on lifting the minimal subnet constraint for ALB. AFAIK, in some region like KIX they only require 1 subnet for ALB, but most regions still require 2 subnets as minimal unless the account is allowlisted. |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerryhe1999, M00nF1sh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3437 +/- ##
==========================================
- Coverage 55.75% 55.75% -0.01%
==========================================
Files 149 149
Lines 8838 8843 +5
==========================================
+ Hits 4928 4930 +2
- Misses 3576 3579 +3
Partials 334 334
☔ View full report in Codecov by Sentry. |
Issue
#3082
Description
Added a new feature gate named "ALBSingleSubnet" with default value false, once it set to true, the user who get whitelisted by AWS ELB team for using only one subnet for their application load balancer could be processed as expected.
Manual Test Items:
For account which doesn't get whitelisted, creating the ingress resource with only one subnet attached.
Comes up with LBC error message while ALBSIngleSubnet is set to false.
Comes up with ELB error message while ALBSIngleSubnet is set to true.
For account which get whitelisted, creating the ingress resource with only one subnet attached.
Comes up with LBC error message while ALBSIngleSubnet is set to false.
ALB is successfully provisioning while ALBSIngleSubnet is set to true.
Checklist
README.md
, or thedocs
directory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯