这是indexloc提供的服务,不要输入任何密码
Skip to content

Use passthrough loadbalancing in activator state keeping #11172

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

Merged

Conversation

markusthoemmes
Copy link
Contributor

Proposed Changes

Ref #10751

This connects the revision watchers in the activator with the networking configmap and makes it sensitive to the EnableMeshPodAddressability setting.

Release Note

The state keeping in the activator is now sensitive to the EnableMeshPodAddressability setting. A restart of the activator is required for the setting to take effect if changed.

/assign @vagababov @julz

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Apr 13, 2021
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/autoscale area/networking labels Apr 13, 2021
@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #11172 (7a0f271) into main (7ac0c4f) will decrease coverage by 0.04%.
The diff coverage is 71.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11172      +/-   ##
==========================================
- Coverage   87.69%   87.65%   -0.05%     
==========================================
  Files         191      191              
  Lines        9195     9209      +14     
==========================================
+ Hits         8064     8072       +8     
- Misses        877      883       +6     
  Partials      254      254              
Impacted Files Coverage Δ
cmd/activator/main.go 0.00% <0.00%> (ø)
pkg/activator/net/throttler.go 88.85% <0.00%> (ø)
pkg/activator/net/revision_backends.go 90.74% <95.83%> (+0.33%) ⬆️
pkg/reconciler/revision/reconcile_resources.go 80.95% <0.00%> (-2.39%) ⬇️
pkg/reconciler/configuration/configuration.go 88.28% <0.00%> (+1.56%) ⬆️

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 7ac0c4f...7a0f271. Read the comment docs.

@@ -264,7 +280,7 @@ func (rw *revisionWatcher) checkDests(curDests, prevDests dests) {

// If we have discovered that this revision cannot be probed directly
// do not spend time trying.
if rw.podsAddressable {
if rw.podsAddressable || rw.usePassthroughLb {
Copy link
Member

Choose a reason for hiding this comment

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

I think this isn't possible since if usePassthroughLb is set we will never try service scraping, and therefore would never mark podAddressable false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough, I still feel like it's worth having it here for added clarity?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe, fwiw it was more confusing to me on first reading: ie even if usePassthroughLb is set it wouldnt make much sense to try to directly access pods if we already determined they're not accessible. Then I realised this never happens anyway. Also if we do want to keep it we should probably update the comment to match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll drop it then.

@@ -301,6 +317,12 @@ func (rw *revisionWatcher) checkDests(curDests, prevDests dests) {
}
}

if rw.usePassthroughLb {
Copy link
Member

Choose a reason for hiding this comment

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

👍️ I like that we'll get a clear indication here if the flag was set and doesnt work, rather than silently falling back and succeeding.

@markusthoemmes markusthoemmes force-pushed the activator-state-passthrough branch from b71930a to 7a0f271 Compare April 14, 2021 07:32
@markusthoemmes
Copy link
Contributor Author

Rebased and added usage of the naming helper.

Copy link
Member

@julz julz left a comment

Choose a reason for hiding this comment

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

/lgtm

// We cannot set these headers unconditionally as the Host header will cause the
// request to be loadbalanced by ingress "silently" if passthrough LB is not
// configured, which will cause the request to "pass" but doesn't guarantee it
// actually lands on the correct pod, which breaks our state keeping.
Copy link
Member

Choose a reason for hiding this comment

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

👍️

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: julz

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2021
@knative-prow-robot knative-prow-robot merged commit bd8d6a0 into knative:main Apr 14, 2021
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. area/autoscale area/networking cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants