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

limit the scope of 169.254.169.252/32 to host #107502

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

zshihang
Copy link
Contributor

@zshihang zshihang commented Jan 12, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:

when a cluster has calico enabled, traffic from node would sometimes use 169.254.169.252 as source ip instead of node ip. we need to change the scope from global to host.

Special notes for your reviewer:

Does this PR introduce a user-facing change?

none

@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/S Denotes a PR that changes 10-29 lines, ignoring generated files. 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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 12, 2022
@zshihang
Copy link
Contributor Author

/sig auth
/priority high
/triage accepted
/cc @mikedanese

@k8s-ci-robot k8s-ci-robot added the sig/auth Categorizes an issue or PR as relevant to SIG Auth. label Jan 12, 2022
@k8s-ci-robot
Copy link
Contributor

@zshihang: The label(s) priority/high cannot be applied, because the repository doesn't have them.

In response to this:

/sig auth
/priority high
/triage accepted
/cc @mikedanese

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 triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 12, 2022
@zshihang
Copy link
Contributor Author

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 12, 2022
@k8s-ci-robot k8s-ci-robot added area/provider/gcp Issues or PRs related to gcp provider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. labels Jan 12, 2022
@aojea
Copy link
Member

aojea commented Jan 12, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:

due to #95790, traffic from node would sometimes use 169.254.169.252 as source ip instead of node ip. we need to change the scope from global to host.

Special notes for your reviewer:

Does this PR introduce a user-facing change?

none

That pr you mention only uses a global unicast addresses from the loopback if there are no other global unicast addresses on the host.

169.254.0.0/24 is link local and should not be picked, do you have an occurrence? I find it weird

@aojea
Copy link
Member

aojea commented Jan 12, 2022

/cc

Kubelet should not take this ip, will take a look later, thanks for reporting

@zshihang
Copy link
Contributor Author

seems #95790 is not relevant here. this happens in a cluster with calico enabled.

@aojea
Copy link
Member

aojea commented Jan 12, 2022

when a cluster has calico enabled, traffic from node would sometimes use 169.254.169.252 as source ip instead of node ip. we need to change the scope from global to host.

is UDP traffic? can you provide more details about the problem?

@zshihang
Copy link
Contributor Author

zshihang commented Jan 12, 2022

it is the healthcheck traffic (TCP) initiated by kubelet, i.e. node -> pod.

if you tcpdump on ip of any pod that has health check configured, you would see something like this:

22:12:13.486826 IP 169.254.169.252.54256 > 10.16.0.10.8093: Flags [S], seq 2990051932, win 42600, options [mss 1420,sackOK,TS val 165524131 ecr 0,nop,wscale 7], length 0
22:12:13.486888 IP 169.254.169.252.54256 > 10.16.0.10.8093: Flags [.], ack 3839683330, win 333, options [nop,nop,TS val 165524132 ecr 2383257463], length 0

this only happens in cluster with calico enabled.

@aojea
Copy link
Member

aojea commented Jan 12, 2022

this only happens in cluster with calico enabled.

there was an issue with this exact problem, I'll try to find it, it was related to some iptables rules doing NAT IIIRC

@aojea
Copy link
Member

aojea commented Jan 12, 2022

I can't find it, but I think that was the same problem, check the iptables rules on the host, I don't know why but sometimes it SNATed the traffic with the link local address, on that issue it was created by the node-local-dns sidecar

@mikedanese
Copy link
Member

/retest

@mikedanese
Copy link
Member

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikedanese, zshihang

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 Jan 13, 2022
@zshihang
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 6b39915 into kubernetes:master Jan 13, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Jan 13, 2022
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/provider/gcp Issues or PRs related to gcp provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants