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

Reduce load on Cilium API by filtering more events #29

Merged

Conversation

deverton-godaddy
Copy link
Contributor

This feature reduces the API call rate to Cilium and tries to ensure netreap only makes calls when needed. This helps in high density scenarios to reduce the CIlium agent API overhead. This feature consists of three main changes:

  1. The allocation events from Nomad include the NodeID where the allocation is assigned. We can use that to drop events early in processing by comparing the event NodeID with the local agent NodeID. This reduces the load on Cilium agents in the cluster as they are no longer queried about allocations that don't exist on the node.
  2. netreap only needs to watch the Allocation event stream and can ignore events for terminal allocations. Nomad will handle cleaning up the endpoint in that case.
  3. Only call the Cilium endpoint patch API if the labels to apply to the endpoint have actually changed. Cilium will do a full endpoint regeneration even if the labels are the same so only doing that on label change this greatly cuts down on load.

The allocation events from Nomad include the NodeID where the allocation
is assigned. We can use that to drop events early in processing by
comparing the event NodeID with the local agent NodeID.

This reduces the load on Cilium agents in the cluster as they are no
longer queried about allocations that don't exist on the node.

Additionally we only need to watch the `Allocation` event stream and can
ignore events for terminal allocations. Nomad will handle cleaning up
the endpoint in that case.
Reduce the load on the Cilium API further by not patching the endpoint
with labels when they haven't changed. This should cut down on endpoint
regeneration times and reduce the chance of hitting API rate limits.
@netlify
Copy link

netlify bot commented Aug 21, 2023

Deploy Preview for netreap canceled.

Name Link
🔨 Latest commit 1a194ee
🔍 Latest deploy log https://app.netlify.com/sites/netreap/deploys/64e3d9aa24b1fe000839f259

@protochron protochron self-requested a review August 21, 2023 21:42
@protochron protochron merged commit c8999d5 into cosmonic-labs:main Aug 29, 2023
7 checks passed
@deverton-godaddy deverton-godaddy deleted the deverton/ignore-more-events branch October 5, 2023 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants