-
Notifications
You must be signed in to change notification settings - Fork 289
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 memory consumption for Kubernetes source configuration #1425
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mszostok
reviewed
Apr 3, 2024
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.
Just the code comments. I will approve it once I will execute it on my end 👍
mszostok
approved these changes
Apr 3, 2024
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.
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Changes proposed in this pull request:
This change groups Kubernetes source configurations by different kubeconfigs and creates a single
dynamicInformerFactory
per group, which essentially brings the implementation close to the 0.18 Kubernetes source one.Stats
Memory consumption shortly after startup:
k8s-all-events2
from the PR instruction)Screenshots
v1.9.1
12 sources:
256Mi request, 384MB limit
Too low, source plugin restarts itself.
1Gi request + 2Gi request
Plugin runs withourt restarting, still multiple DeltaFIFO logs
1 source (
k8s-all-events2
from the testing instruction)No sources enabled
After changes in this PR:
12 Sources (from the testing instruction)
Requests 128Mi, limit 256Mi:
No DeltaFIFO logs, just a warning about client-side throttling:
And Slack API rate limits:
1 source (
k8s-all-events2
from the testing instruction)No sources enabled
Testing
Check out this PR:
Create k3d cluster
Build and serve plugins:
Install kube-prometheus-stack:
Forward Grafana port:
Navigate to http://localhost:3003 and log in with admin / prom-operator credentials.
Install ArgoCD + Flux on the cluster:
Install previous Botkube
Install previous Botkube version with the following configuration (fill the Slack tokens):
Details
In the Grafana dashboard, navigate to the
1. Kubernetes / Compute Resources / Pod
dashboard and select the Botkube pod. Observe the memory consumption.Install current Botkube
Install current Botkube version with the following configuration (fill the Slack tokens):
Details
In the Grafana dashboard, navigate to the
1. Kubernetes / Compute Resources / Pod
dashboard and select the Botkube pod. Observe the memory consumption.Related issue(s)
Resolves #1403