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

Cross-Zone Load Balancing for API ELB #6958

Merged
merged 7 commits into from
Aug 1, 2019

Conversation

austinmoore-
Copy link
Contributor

Adds configuration (spec.api.loadBalancer.crossZoneLoadBalancing) to enable cross-zone load balancing on the API ELB. See the added docs for details.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 13, 2019
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 13, 2019
@austinmoore-
Copy link
Contributor Author

/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 {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yep 👍

Copy link
Contributor

@KashifSaadat KashifSaadat left a 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 {
Copy link
Contributor

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.

Copy link
Contributor Author

@austinmoore- austinmoore- May 20, 2019

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

@KashifSaadat
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 16, 2019
@justinsb
Copy link
Member

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
Copy link
Member

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)

@justinsb
Copy link
Member

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2019
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2019
@austinmoore-
Copy link
Contributor Author

/retest

@@ -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)
Copy link
Member

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.

@austinmoore-
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 26, 2019
@austinmoore-
Copy link
Contributor Author

@justinsb or @rifelpet can you do another quick review and lgtm for the rebase?

@rifelpet
Copy link
Member

/lgtm

Thanks @austinmoore- !

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 31, 2019
@rifelpet
Copy link
Member

I'm hoping that #7348 will fix these job failures

@rifelpet
Copy link
Member

rifelpet commented Aug 1, 2019

/retest

@k8s-ci-robot k8s-ci-robot merged commit c705116 into kubernetes:master Aug 1, 2019
@austinmoore- austinmoore- deleted the api-elb-cross-zone branch August 1, 2019 14:29
k8s-ci-robot added a commit that referenced this pull request Aug 1, 2019
digitalronin added a commit to ministryofjustice/cloud-platform-terraform-kops that referenced this pull request Nov 4, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants