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

Revert removal of support for TCP and UDP services #3374

Merged
merged 4 commits into from
Nov 18, 2018

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Nov 7, 2018

What this PR does / why we need it:

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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 7, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 7, 2018
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 12, 2018
@aledbf aledbf force-pushed the restore-tcp-udp branch 4 times, most recently from d61cf7c to 60e540f Compare November 16, 2018 15:30
@aledbf aledbf mentioned this pull request Nov 16, 2018
@aledbf aledbf force-pushed the restore-tcp-udp branch 2 times, most recently from c76f98b to 7b3f3eb Compare November 16, 2018 15:39
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 16, 2018
@aledbf aledbf force-pushed the restore-tcp-udp branch 2 times, most recently from 69cacfb to 139caa4 Compare November 16, 2018 16:00
@aledbf
Copy link
Member Author

aledbf commented Nov 16, 2018

@ElvinEfendi this is ready for an initial review. I will add e2e tests

@aledbf aledbf changed the title WIP: Revert removal of support for TCP and UDP services Revert removal of support for TCP and UDP services Nov 16, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 16, 2018
end

local ctx = ngx.ctx
if not ctx.has_run then
Copy link
Member

Choose a reason for hiding this comment

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

why is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

This is going to effectively ignore proxy_next_upstream_tries and will always try next upstream peer only once.

I think we should keep the same logic we have for http subsystem here.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

if err != nil {
return err
}
defer conn.Close()
Copy link
Member

Choose a reason for hiding this comment

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

you already have this above, why do you need it again?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

defer conn.Close()
}
}()

Copy link
Member

Choose a reason for hiding this comment

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

This is just a mock right? If so can you extract this into a function that describes it?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

return false
}
}
if len(c1.PassthroughBackends) != len(c2.PassthroughBackends) {
Copy link
Member

Choose a reason for hiding this comment

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

This is not related to UDP TCP revert, right? Seems like needs to be grouped with line 90.

resp, _, errs := gorequest.New().
Get(fmt.Sprintf("http://%v:%v", ip, port)).
End()
Expect(len(errs)).Should(BeNumerically("==", 0))
Copy link
Member

Choose a reason for hiding this comment

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

Can you use BeEmpty instead? That will reveal more when error happens.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Get(fmt.Sprintf("http://%v:%v", ip, port)).
End()
Expect(len(errs)).Should(BeNumerically("==", 0))
Expect(resp.StatusCode).Should(Equal(200))
Copy link
Member

Choose a reason for hiding this comment

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

What are you asserting here with an HTTP request?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am asserting the response from the echo deployment request returns 200 (I am not sure what to exactly test)

Copy link
Member

Choose a reason for hiding this comment

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

Ideally we would need something similar to echo deployment but instead of HTTP it should be speaking TCP. Then instead of sending HTTP request we could send TCP stream and assert on expected stream response.

@ElvinEfendi
Copy link
Member

@aledbf this is looking good! Just a few minor comments. e2e test coverage can be improved a bit to make sure it actually load balances across backends - that will ensure core feature works.

Later I'll try to refactor Lua code and unify stream and http subsystems to avoid duplication in balancer modules.

@ElvinEfendi
Copy link
Member

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, 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:

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 bf7ad0d into kubernetes:master Nov 18, 2018
@aledbf aledbf deleted the restore-tcp-udp branch November 18, 2018 16:53
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/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.

3 participants