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

enable dynamic backend configuration by default #2794

Merged
merged 3 commits into from
Jul 27, 2018
Merged

enable dynamic backend configuration by default #2794

merged 3 commits into from
Jul 27, 2018

Conversation

ElvinEfendi
Copy link
Member

What this PR does / why we need it:
We have introduced dynamic backend configuration feature at #2174 on 18th March and since then improved the initial implementation and fixed bugs. Several people/companies have already been successfully running ingress-nginx with this feature enabled. In this mode ingress-nginx also provides a more advanced load balancing algorithm that can be enabled using load-balance (set to ewma) configmap setting or annotation. However least_conn and ip_hash are not available in this mode. Also note #2662.

For an idea of how many reloads this feature can skip check out the following graph (EDT time):
screen shot 2018-07-16 at 9 43 42 pm
As you can see during work hours on average 25 reloads every 5m. Note that this ingress-nginx instance has more than 500 upstreams and the app behind gets deployed dozens of times during working hours.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 17, 2018
@aledbf aledbf added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jul 17, 2018
@aledbf
Copy link
Member

aledbf commented Jul 17, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2018
@mikebryant
Copy link
Contributor

#2797 has been a significant regression for us - Making this flag the default with that outstanding seems like a bad idea?

At the very least it should be called out in the release notes.

@antoineco
Copy link
Contributor

/lgtm

@aledbf
Copy link
Member

aledbf commented Jul 17, 2018

At the very least it should be called out in the release notes.

This will be added to the release notes.

@aledbf
Copy link
Member

aledbf commented Jul 17, 2018

Making this flag the default with that outstanding seems like a bad idea?

Actually, this is a good idea. We just need to add the missing e2e tests (like externalName) to make sure there are no regressions.

@aledbf
Copy link
Member

aledbf commented Jul 17, 2018

@mikebryant if you have the time and are willing to help you can add such e2e test in a new PR

@@ -77,7 +77,7 @@ const (
sslSessionCacheSize = "10m"

// Default setting for load balancer algorithm
defaultLoadBalancerAlgorithm = "least_conn"
defaultLoadBalancerAlgorithm = ""
Copy link

Choose a reason for hiding this comment

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

why not set this to "round_robin"?

Copy link
Member Author

@ElvinEfendi ElvinEfendi Jul 26, 2018

Choose a reason for hiding this comment

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

@diazjf technically it would not matter in our case since we have a guard in buildLoadBalancingConfig to return "" when it is round_robin, but I'd like to stick to Nginx standard. And Nginx does not let you configure it as round_robin inside an upstream section. You would get:

 unknown directive "round_robin"

if you do so.

@antoineco
Copy link
Contributor

Worth noting https://kubernetes.github.io/ingress-nginx/how-it-works/ would benefit from an update after this gets merged.

@RutledgePaulV
Copy link

Similarly to the discussion above, #2513 is a significant issue for us and should either be fixed before this becomes the default or should be documented as a breaking regression when consuming this version.

@antoineco
Copy link
Contributor

/lgtm cancel

Considering the edges cases uncovered by users I think we should be careful and either:

  • draft a beta for 0.18
  • have a big warning in the release notes and make this the default only in 0.19 (my preference)

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 22, 2018
@ElvinEfendi
Copy link
Member Author

I am already addressing the one related to externa name service. I will then address custom error one before getting back to this PR. I don’t think we should merge this without addressing those two issues.

@antoineco
Copy link
Contributor

These are only the ones reported by users, I'm almost certain there will be more. Ideally we should run the entire e2e test suite for both modes, but e2e tests are also incomplete at the moment.

@ElvinEfendi
Copy link
Member Author

I addressed the two issues in #2852 and #2804.

@ElvinEfendi
Copy link
Member Author

Worth noting https://kubernetes.github.io/ingress-nginx/how-it-works/ would benefit from an update after this gets merged.

👍 I'll adjust it accordingly in another PR.

@antoineco regarding to #2794 (comment), I think users have been running dynamic mode since few versions ago already and they have reported several issues the two above-mentioned being the recent ones which they are fixed now as well.

I like the idea of highlighted message in release notes to make sure people are aware of this big change.

Given above I think we can make this part of 0.18 release.

@aledbf
Copy link
Member

aledbf commented Jul 26, 2018

Given above I think we can make this part of 0.18 release.

+1

@ElvinEfendi
Copy link
Member Author

/hold

let's wait for @antoineco

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 26, 2018
@antoineco
Copy link
Contributor

After discussing with Elvin, I'm in favor of merging this and drafting a beta.
There is no other major feature making it to 0.18, which I believe is a good occasion to get this in.

/lgtm

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

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 26, 2018
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 27, 2018
var _ = framework.IngressNginxDescribe("Annotations - Affinity", func() {
f := framework.NewDefaultFramework("affinity")

BeforeEach(func() {
err := f.NewEchoDeploymentWithReplicas(2)
err := f.DisableDynamicConfiguration()
Expect(err).NotTo(HaveOccurred())
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a known limitation of affinity implementation in dynamic mode as described at #2662. The core affinity features are supported in dynamic mode and there are tests for them at test/e2e/lua/dynamic_configuration.go. It is only https://github.com/kubernetes/ingress-nginx/pull/2794/files#diff-7d332a0e5ba59e06193678d5a83909d0R102 that's not supported yet as described in the issue.

@ElvinEfendi
Copy link
Member Author

The CI will keep failing until #2853 gets merged.

@antoineco
Copy link
Contributor

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, antoineco, ElvinEfendi

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:
  • OWNERS [ElvinEfendi,aledbf,antoineco]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov-io
Copy link

Codecov Report

Merging #2794 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2794      +/-   ##
==========================================
+ Coverage   47.39%   47.41%   +0.01%     
==========================================
  Files          75       75              
  Lines        5433     5433              
==========================================
+ Hits         2575     2576       +1     
  Misses       2530     2530              
+ Partials      328      327       -1
Impacted Files Coverage Δ
internal/ingress/controller/config/config.go 98.26% <ø> (ø) ⬆️
internal/ingress/controller/template/template.go 66.25% <100%> (+0.2%) ⬆️
cmd/nginx/flags.go 83.33% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d263577...6641aa5. Read the comment docs.

@k8s-ci-robot k8s-ci-robot merged commit 18cc2be into kubernetes:master Jul 27, 2018
@ElvinEfendi ElvinEfendi deleted the enable-dynamic-confoguration branch July 27, 2018 12:42
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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants