Skip to content

endpoint: don't propagate health/ingress endpoints to kvstore #35997

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

Merged

Conversation

giorio94
Copy link
Member

Health and ingress IPs are propagated to the other Cilium agents via CiliumNodes, and the equivalent kvstore representation. However, they are also additionally upserted into the kvstore as endpoints, leading to information duplication both in the kvstore and inside the user-space ipcache representation of all remote nodes (as observed via the cilium ip list command). Indeed, they get upserted both as single IPs (i.e., without netmask) when observed from the endpoint prefix, and as prefix (with /32 mask) when observed from the node prefix. The same does not happen when operating in CRD mode, because the corresponding CEPs do not get created in these cases.

Let's fix this divergence by avoiding to upsert these entries in the kvstore case as well. Considering an upgrade scenario, the stale health/ingress entries will be automatically deleted when the corresponding lease expires (by default after 15 minutes). Still, this does not create any problems, because all other agents would observe the deletion event, clean-up the duplicate internal entries, but not propagate the deletion event down to the datapath (and the other subsystems), given that another CIDR entry for the same IP is still present [1], hence preserving correctness.

[1]:

// The endpoint IP and the CIDR are associated with the
// same identity and host IP. Nothing changes for the
// listeners.
callbackListeners = false

Stop propagating duplicate health and ingress endpoint information to the kvstore

Health and ingress IPs are propagated to the other Cilium agents via
CiliumNodes, and the equivalent kvstore representation. However, they
are also additionally upserted into the kvstore as endpoints, leading
to information duplication both in the kvstore and inside the user-space
ipcache representation of all remote nodes (as observed via the `cilium
ip list` command). Indeed, they get upserted both as single IPs (i.e.,
without netmask) when observed from the endpoint prefix, and as prefix
(with /32 mask) when observed from the node prefix. The same does not
happen when operating in CRD mode, because the corresponding CEPs do
not get created in these cases.

Let's fix this divergence by avoiding to upsert these entries in the
kvstore case as well. Considering an upgrade scenario, the stale
health/ingress entries will be automatically deleted when the
corresponding lease expires (by default after 15 minutes). Still, this
does not create any problems, because all other agents would observe
the deletion event, clean-up the duplicate internal entries, but not
propagate the deletion event down to the datapath (and the other
subsystems), given that another CIDR entry for the same IP is still
present [1], hence preserving correctness.

[1]: https://github.com/cilium/cilium/blob/40dde8b83c9829ae8288b3be0e8d6bdba256da0c/pkg/ipcache/ipcache.go#L428-L431

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
@giorio94 giorio94 added release-note/minor This PR changes functionality that users may find relevant to operating Cilium. area/kvstore Impacts the KVStore package interactions. labels Nov 15, 2024
@giorio94 giorio94 requested a review from a team as a code owner November 15, 2024 13:48
@giorio94
Copy link
Member Author

/test

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 15, 2024
@aanm aanm added this pull request to the merge queue Nov 18, 2024
Merged via the queue into cilium:main with commit d9ce9f3 Nov 18, 2024
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kvstore Impacts the KVStore package interactions. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants