Skip to content

Conversation

tklauser
Copy link
Member

@tklauser tklauser commented Nov 3, 2023

Forward port #27406 to v1.13 with several edits (partially following #27010) without the revert of #26958, because that was never applied to v1.13. Supersedes #27010.

Passes the first two test cases of the test script for v1.13 (slightly adjusted from the v1.12 test script used for #27406):

-- PASSED delete-node-then-associate-svc for kind-worker3 (172.18.0.5) at Fri  3 Nov 14:05:27 UTC 2023
[...]
-- PASSED delete-node-then-associate-kubeapi for kind-worker4 (172.18.0.2) at Fri  3 Nov 14:05:28 UTC 2023

See commit message for detailed backporter notes.

Closes #27010

@tklauser tklauser added release-note/bug This PR fixes an issue in a previous release of Cilium. kind/backports This PR provides functionality previously merged into master. release-blocker/1.13 labels Nov 3, 2023
@tklauser tklauser force-pushed the pr/tklauser/v1.13/ipcache-metadata-delete branch from e57c426 to 876abc4 Compare November 3, 2023 14:12
@tklauser tklauser requested a review from joestringer November 3, 2023 14:12
@tklauser tklauser marked this pull request as ready for review November 3, 2023 14:13
@tklauser tklauser requested a review from a team as a code owner November 3, 2023 14:13
@tklauser tklauser changed the title [v1.13] node: Remove labels from ipcache on delete events [v1.13] Remove remote-node labels from ipcache on node delete Nov 3, 2023
@tklauser tklauser added the area/agent Cilium agent related. label Nov 3, 2023
@tklauser tklauser self-assigned this Nov 3, 2023
[ upstream commit 6d1c07e ]

[ backporter's note: several merge conflict in
  pkg/node/manager/manager.go:
  1) Removed additional (*IPCache).RemoveMetadata in
     pkg/ipcache/metadata.go in favor of the existing implementation in
     pkg/ipcache/ipcache.go.
  2) Changed RemoveMetadata in IPCache interface to RemoveLabels and
     adjusted parameters so pkg/ipcache.(*IPCache) satisfies the
     interface.
  3) Adjusted m.deleteIPCache calls in (*Manager).NodeUpdated for health
     IPs by adding identity.IdentityUnknown and the resource ID to the
     existing calls.
  4) Adjusted (*Manager).deleteIPCache and (*Manager).removeFromIDMD
     parameters to match what (*IPCache).RemoveLabels expects.
  5) Use prefix in call to m.removeFromIDMD, per
     https://github.com/cilium/cilium/pull/27010/files#r1342807054 ]

Previously the node manager code only ever performed upserts into the
ipcache for remote-node labels on node creation/update events. However,
it never cleaned up these labels upon delete. As a result, if a node was
ever removed, then Cilium would continue to consider traffic towards
that IP as traffic reaching towards a remote node. In extreme cases,
this IP could be reallocated to another host in the network which could
cause connectivity disruption to that peer, particularly if the new peer
is subject to CIDR or Entities based policies.

Signed-off-by: Joe Stringer <joe@cilium.io>
Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser force-pushed the pr/tklauser/v1.13/ipcache-metadata-delete branch from 876abc4 to 6555df0 Compare November 3, 2023 14:33
@tklauser
Copy link
Member Author

tklauser commented Nov 6, 2023

/test-backport-1.13

Job 'Cilium-PR-K8s-1.26-kernel-net-next' failed:

Click to show.

Test Name

K8sDatapathServicesTest Checks N/S loadbalancing Tests with direct routing and DSR

Failure Output

FAIL: Can not connect to service "tftp://[fd04::11]:31725/hello" from outside cluster (3/10)

Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.26-kernel-net-next/1032/

If it is a flake and a GitHub issue doesn't already exist to track it, comment /mlh new-flake Cilium-PR-K8s-1.26-kernel-net-next so I can create one.

Then please upload the Jenkins artifacts to that issue.

@tklauser tklauser requested a review from christarazi November 7, 2023 07:46
@tklauser
Copy link
Member Author

tklauser commented Nov 7, 2023

@tklauser
Copy link
Member Author

tklauser commented Nov 7, 2023

/test-1.22-4.19

VM provisioning failed: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.22-kernel-4.19/285/

@christarazi christarazi merged commit 8254b18 into v1.13 Nov 8, 2023
@christarazi christarazi deleted the pr/tklauser/v1.13/ipcache-metadata-delete branch November 8, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent Cilium agent related. kind/backports This PR provides functionality previously merged into master. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
No open projects
Status: Released
Development

Successfully merging this pull request may close these issues.

4 participants