-
Notifications
You must be signed in to change notification settings - Fork 40.3k
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
Correctly Clear conntrack entry on endpoint changes when using nodeport #71573
Conversation
Hi @JacobTanenbaum. 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 Once the patch is verified, the new status will be reflected by the 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. |
40d5889
to
cf3d07b
Compare
/ok-to-test |
/lgtm |
pkg/util/conntrack/conntrack.go
Outdated
@@ -107,3 +107,19 @@ func ClearEntriesForNAT(execer exec.Interface, origin, dest string, protocol v1. | |||
} | |||
return nil | |||
} | |||
|
|||
// ClearEntriesForNATPort uses the conntrack tool to delete the contrack entries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: docblock function name mismatch
/retest |
When using NodePort to connect to an endpoint using UDP, if the endpoint is deleted on restoration of the endpoint traffic does not flow. This happens because conntrack holds the state of the connection and the proxy does not correctly clear the conntrack entry for the stale endpoint. Introduced a new function to conntrack ClearEntriesForPortNAT that uses the endpointIP and NodePort to remove the stale conntrack entry and allow traffic to resume when the endpoint is restored. Signed-off-by: Jacob Tanenbaum <jtanenba@redhat.com>
cf3d07b
to
144280e
Compare
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @JacobTanenbaum
@JacobTanenbaum can you add the release note to the PR description per #71573 (comment) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/milestone v1.14 |
@smarterclayton can you take a quick look at this one? |
@bowei any thoughts on this one? |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JacobTanenbaum, smarterclayton 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 |
A previous PR (kubernetes#71573) intended to clear conntrack entry on endpoint changes when using nodeport by introducing a dedicated function to remove the stale conntrack entry on the node port and allow traffic to resume. By doing so, it has introduced a nodeport specific bug where the conntrack entries related to the ClusterIP does not get clean if endpoint is changed (issue kubernetes#96174). We fix by doing ClusterIP cleanup in all cases.
A previous PR (kubernetes#71573) intended to clear conntrack entry on endpoint changes when using nodeport by introducing a dedicated function to remove the stale conntrack entry on the node port and allow traffic to resume. By doing so, it has introduced a nodeport specific bug where the conntrack entries related to the ClusterIP does not get clean if endpoint is changed (issue kubernetes#96174). We fix by doing ClusterIP cleanup in all cases.
When using NodePort to connect to an endpoint using UDP, if the endpoint is deleted on
restoration of the endpoint traffic does not flow. This happens because conntrack holds
the state of the connection and the proxy does not correctly clear the conntrack entry
for the stale endpoint.
Introduced a new function to conntrack ClearEntriesForPortNAT that uses the endpointIP
and NodePort to remove the stale conntrack entry and allow traffic to resume when
the endpoint is restored.
Signed-off-by: Jacob Tanenbaum jtanenba@redhat.com
release note
/kind bug
fixes #59368