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

Use knative service for wathola receiver if available #4430

Closed

Conversation

cardil
Copy link
Contributor

@cardil cardil commented Oct 28, 2020

Is related to #3175

This PR isn't doing #3175 a full justice. This is a minor improvement, in which we can get receiver report even if given K8s cluster doesn't a worker node external, reachable address. It's done when there is a Serving component available.

Such a situation arisen on our team when we were trying to incorporate upgrade tests in our product (see openshift-knative/serverless-operator#530 (comment)).

Proposed Changes

  • If Serving.Use flag is set deploy a kservice and get it's URL instead of relying on worker node internal address

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 28, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 28, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cardil
To complete the pull request process, please assign chizhg after the PR has been reviewed.
You can assign the PR to them by writing /assign @chizhg in a comment when ready.

The full list of commands accepted by this bot can be found 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 area/test-and-release Test infrastructure, tests or release label Oct 28, 2020
@codecov
Copy link

codecov bot commented Oct 28, 2020

Codecov Report

Merging #4430 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4430   +/-   ##
=======================================
  Coverage   81.06%   81.06%           
=======================================
  Files         281      281           
  Lines        7981     7981           
=======================================
  Hits         6470     6470           
  Misses       1122     1122           
  Partials      389      389           

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 766a24c...bb66221. Read the comment docs.

@cardil
Copy link
Contributor Author

cardil commented Oct 29, 2020

/hold

Some additional changes are required

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 29, 2020
@cardil cardil changed the title Bugfix: ksvc receiver if available Use knative service for wathola receiver if available Oct 30, 2020
@cardil
Copy link
Contributor Author

cardil commented Oct 30, 2020

/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 30, 2020
@cardil cardil force-pushed the bugfix/ksvc-receiver-if-available branch 2 times, most recently from c3b5447 to 4606e66 Compare October 30, 2020 18:37
@matzew
Copy link
Member

matzew commented Oct 31, 2020

/test all

@cardil cardil force-pushed the bugfix/ksvc-receiver-if-available branch from 4606e66 to 28fbbb2 Compare November 2, 2020 12:55
@zhongduo
Copy link
Contributor

zhongduo commented Nov 2, 2020

/assign @zhongduo

@zhongduo
Copy link
Contributor

zhongduo commented Nov 2, 2020

Thanks for adding this. I do think having the requirement of accessing from external can be a big headache and was considering doing similar thing for our CI test.

@zhongduo
Copy link
Contributor

zhongduo commented Nov 3, 2020

Do I understand correctly that all the extra logic, including the forwarder, is just to make an http request to /report, did you consider using the curl container instead of implementing all the logic?

@cardil
Copy link
Contributor Author

cardil commented Nov 4, 2020

/hold

Upgrading serving component causes the receiver ksvc to restart and loose track of transmitted events.

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2020
@cardil
Copy link
Contributor Author

cardil commented Nov 4, 2020

Do I understand correctly that all the extra logic, including the forwarder, is just to make an http request to /report, did you consider using the curl container instead of implementing all the logic?

Those are sending, and receiving cloud events. On receiving part those are keep track. At test end sender sends finished event with number of events he successfully pushed to eventing broker. That's why receiver can calculate and return report of propagated events. Forwarder component is there to test that if we don't loose events on ksvc autoscaling components. More info on upgrade readme file.

Yes. I think that's possible to deploy curl like job, request an internal in cluster address, and read json from jobs logs. That's good alternative to original idea of using configmaps and k8s events.

return u
}

func fetchReceiverReport(u *url.URL, log *zap.SugaredLogger) *Report {
log.Infof("Fetching receiver report from: %v", u)
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: perhaps this log should be updated as well since the preferred pattern seems to be not using Infof when there is a single variable at the end

@cardil cardil deleted the bugfix/ksvc-receiver-if-available branch November 6, 2020 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

5 participants