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

e2e/service.go: remove same node nodeport test #123622

Merged

Conversation

aauren
Copy link
Contributor

@aauren aauren commented Mar 1, 2024

What type of PR is this?

/kind bug
/kind cleanup

What this PR does / why we need it:

Remove local pod -> local nodeport test from Services [It] should fallback to local terminating endpoints when there are no ready endpoints with externalTrafficPolicy=Local test.

How local external traffic policy influences behavior has been a hotly contested topic in the past. @danwinship created an issue several years ago for discussing exactly what the sig-network stance on this is here: #108526

In it, several sig-network members went back and forth, but ultimately decided that local pod -> LB IP and local pod -> local NodePort would remain exceptions from the "destination" interpretation of traffic policy.

However, in the case of local pod -> local NodePort the exception for this was primarily made because sig-network didn't want to disrupt kube-proxy's existing functionality. I think that this was ultimately the right call for kube-proxy, but I think that it still makes sense to allow other Kubernetes network providers to interpret this in a way that makes sense for them.

In kube-router's case, interpreting local pod -> local NodePort as external traffic not only keeps it consistent with the "destination" interpretation of traffic policy, but also keeps existing functionality in a decision similar to sig-network's WRT kube-proxy.

Given that:

  • This e2e test is supposed to be testing traffic policy's termination logic and not the semantics of local pod -> local NodePort functionality
  • That the current exception held by sig-network for local pod -> local NodePort is primarily held to keep kube-proxy consistent and not for it's ideological merits

I think that it would be beneficial to the community to remove this one line from the sig-network e2e battery of tests.

Special notes for your reviewer:

FYI @danwinship @aojea @andrewsykim

Existing conversation on this can be found in Slack thread: https://kubernetes.slack.com/archives/C09QYUH5W/p1709310311449749

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 1, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 1, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @aauren. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Mar 1, 2024
@k8s-ci-robot k8s-ci-robot added area/test sig/network Categorizes an issue or PR as relevant to SIG Network. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 1, 2024
@aojea
Copy link
Member

aojea commented Mar 1, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 1, 2024
@@ -3119,7 +3119,6 @@ var _ = common.SIGDescribe("Services", func() {

execHostnameTest(*pausePod0, nodePortAddress0, webserverPod0.Name)
execHostnameTest(*pausePod1, nodePortAddress0, webserverPod0.Name)
execHostnameTest(*pausePod1, nodePortAddress1, webserverPod0.Name)
Copy link
Member

Choose a reason for hiding this comment

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

we need to update the comments above to explain what is going on, and also mention that this case is not tested with references to the discussions

Copy link
Member

Choose a reason for hiding this comment

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

ok, so this assumes that a pod serving in in nodeA should be reachable from a pod in nodeB that connectes to a nodePort in the same node .... 😄 a bit of a stretch I'm fine with this change, seems an artifact of kube-proxy implementation and at minimum debatable from a more fine interpretation

Copy link
Contributor

Choose a reason for hiding this comment

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

I need to do some more updates to https://github.com/kubernetes-sigs/kpng/blob/master/doc/service-proxy.md. It mentions the LB IP case but doesn't say anything about NodePorts+eTP:Local.

Anyway, I agree that this is testing an artifact of kube-proxy's implementation that I don't think we actually agreed was supposed to be the behavior for all service proxy implementations. (Which means maybe we should make nftables not do it that way?)

Note that we already have a unit test for pod-to-eTP:Local-NodePort in iptables that asserts the same behavior as seen here, so removing this test will not leave us in danger of regressing that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the comments, let me know what you think.

Remove local pod -> local nodeport from service termination test
@aauren aauren force-pushed the remove_same_node_nodeport_test branch from 500d997 to d205150 Compare March 1, 2024 23:01
@aojea
Copy link
Member

aojea commented Mar 1, 2024

/lgtm
/approve

#123622 (comment)

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

LGTM label has been added.

Git tree hash: fa46ccdb88b938511b3c5498b21ff8b8c068ed93

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aauren, aojea

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2024
@k8s-ci-robot
Copy link
Contributor

@aauren: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-e2e-gce-providerless d205150 link false /test pull-kubernetes-e2e-gce-providerless

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot merged commit f4b0115 into kubernetes:master Mar 2, 2024
17 of 19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.30 milestone Mar 2, 2024
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/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants