-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Cross-Zone Load Balancing for API ELB #6958
Cross-Zone Load Balancing for API ELB #6958
Conversation
Hi @austinmoore-. Thanks for your PR. I'm waiting for a kubernetes 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. |
/assign @KashifSaadat |
@@ -166,6 +166,9 @@ func (_ *LoadBalancer) modifyLoadBalancerAttributes(t *awsup.AWSAPITarget, a, e, | |||
if e.ConnectionSettings != nil && e.ConnectionSettings.IdleTimeout != nil { | |||
request.LoadBalancerAttributes.ConnectionSettings.IdleTimeout = e.ConnectionSettings.IdleTimeout | |||
} | |||
if e.CrossZoneLoadBalancing != nil && e.CrossZoneLoadBalancing.Enabled != nil { |
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.
Should this be an else off the if statement on line 136?
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.
Ah yep 👍
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.
One minor comment, thanks for the great PR :)
@@ -153,6 +153,13 @@ func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error { | |||
Tags: tags, | |||
} | |||
|
|||
// Only set if specified so we don't change existing logic | |||
if lbSpec.CrossZoneLoadBalancing != nil { |
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.
Small test:
- Deploy with
crossZoneLoadBalancing
unset; by default the value on the ELB is set to false - Set the above in kops spec with value
true
; this is successfully set to true in the ELB Spec - Revert to original configuration (not explicitly setting in the LoadBalancerSpec to false); no change to the ELB configuration (the value remains true on the ELB resource)
Just a small suggestion that if crossZoneLoadBalancing
is unset in the LoadBalancerSpec, the ELB property is explicitly set to false (maintains existing behaviour), so the above potential use-case is satisfied.
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.
Yeah, you're correct, it remains true. I'll make that change
/ok-to-test |
e200407
to
2b1e236
Compare
This looks good - thanks @austinmoore- I think at some stage in the future we might well want to make this the default, but we'd have to have a big release note for that so we can hold off for now :-) The other option is just to make it the default for new clusters that use an ELB. |
@@ -0,0 +1,96 @@ | |||
apiVersion: kops/v1alpha2 |
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.
It's often easier to throw this into "complex" or another existing test (and it's OK to do so, at least when it's a whole test for a single field)
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: austinmoore-, justinsb 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 |
/retest |
cmd/kops/integration_test.go
Outdated
@@ -80,6 +80,11 @@ func TestComplex(t *testing.T) { | |||
runTestAWS(t, "complex.example.com", "complex", "legacy-v1alpha2", false, 1, true, nil) | |||
} | |||
|
|||
// TestCrossZone tests that the the cross zone setting on the API ELB is set properly | |||
func TestCrossZone(t *testing.T) { | |||
runTestAWS(t, "crosszone.example.com", "api_elb_cross_zone", "v1alpha2", false, 1, true, nil) |
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.
The function signature for runTestAWS
recently changed in the master branch. You'll want to rebase your branch and add the new boolean argument. Alternatively you can follow justinsb's advice and add the setting to the existing complex
integration test.
/retest |
2b1e236
to
29b4662
Compare
/lgtm Thanks @austinmoore- ! |
I'm hoping that #7348 will fix these job failures |
/retest |
Cherry pick of #6958 onto release-1.14
This should cause each node of the load-balancer to distribute traffic across *all* worker nodes. Without it, each LB node (one per AZ) only distributes traffic to worker nodes in the same AZ. This is a less resilient configuration. In testing, applying this change was extremely quick, and caused no downtime to the test ingress, with a load test running while the change was applied. More info: * kubernetes/kops#6958 * https://gist.github.com/digitalronin/6a131807ff90b2835fd9d53092bde44b * https://mojdt.slack.com/archives/C57UPMZLY/p1604482776372900 * https://console.aws.amazon.com/support/home#/case/?displayId=7467429111&language=en
Adds configuration (
spec.api.loadBalancer.crossZoneLoadBalancing
) to enable cross-zone load balancing on the API ELB. See the added docs for details.