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

Fix buildupstream name to work with dynamic session affinity #2340

Merged
merged 3 commits into from
Apr 12, 2018

Conversation

zrdaley
Copy link
Contributor

@zrdaley zrdaley commented Apr 12, 2018

What this PR does / why we need it:

When dynamic configuration is enabled, ngx.var.proxy_upstream_name is used to get the current backend (stored on the NGINX configuration) in the balancer lua module. This variable is created in buildUpstreamName() in /internal/ingress/controller/controller.go.

PROBLEM: Backends stored in the NGINX configuration do not use the convention sticky-<upstream-name> when dynamic configuration is enabled. If ngx.var.proxy_upstream_name uses the sticky convention this will cause a 500 internal server error.

This PR prevent buildUpstreamName from using the naming convention sticky-<upstream-name> when dynamic configuration is enabled prevent 500 internal server errors.

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

Special notes for your reviewer:
This is a prerequisite for dynamically configured sessions affinity [INSERT PR HERE]

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 12, 2018
@aledbf
Copy link
Member

aledbf commented Apr 12, 2018

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 12, 2018
@ElvinEfendi
Copy link
Member

you need to update buildUpstreamName call at https://github.com/Shopify/ingress/blob/9198e2c14b616414d047ab733d4a2f29a464a02b/rootfs/etc/nginx/template/nginx.tmpl#L775 too

@codecov-io
Copy link

Codecov Report

Merging #2340 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2340      +/-   ##
==========================================
+ Coverage   37.81%   37.86%   +0.05%     
==========================================
  Files          72       72              
  Lines        5144     5145       +1     
==========================================
+ Hits         1945     1948       +3     
+ Misses       2902     2901       -1     
+ Partials      297      296       -1
Impacted Files Coverage Δ
internal/file/bindata.go 55.78% <ø> (ø) ⬆️
internal/ingress/controller/template/template.go 65.45% <100%> (+0.5%) ⬆️

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 353c631...4b11fe4. Read the comment docs.

@aledbf
Copy link
Member

aledbf commented Apr 12, 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 Apr 12, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, zrdaley

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 merged commit cd4ddb7 into kubernetes:master Apr 12, 2018
@zrdaley zrdaley deleted the sticky-upstream-name branch April 12, 2018 20:20
@aledbf
Copy link
Member

aledbf commented Apr 12, 2018

@zrdaley thanks!

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.

5 participants