-
Notifications
You must be signed in to change notification settings - Fork 119
Only cache pods and taskruns with the buildrun label #1869
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
Only cache pods and taskruns with the buildrun label #1869
Conversation
75d7377
to
c017474
Compare
84df79b
to
12cbd8b
Compare
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.
This LGTM - I'm assuming the cache behavior before was to cache all pods and TaskRuns on the cluster? If so, it makes sense to only cache what we care about for the controller.
Co-authored-by: Benjamin Isinger <[email protected]> Signed-off-by: Sascha Schwarze <[email protected]>
12cbd8b
to
4c70d2c
Compare
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qu1queee 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 |
2359c11
into
shipwright-io:main
Changes
When we create a TaskRun for a BuildRun, then we always add the
buildrun.shipwright.io/name
label. Tekton also applies this to the pod it creates.This change configures the cache of our manager to only cache TaskRuns and Pods that have this label. This should bring down the memory usage of our controller a lot, especially when it runs in a cluster that is used for not just Shipwright and has many pods and maybe also taskruns which are not applicable. It may also improve startup time. In my local home cluster, "just" 391 pods and 258 taskruns in total where for each only 25 are BuildRun-related, the memory usage after startup went down from 33 MB to 20 MB.
I had to move up the scheme registration to before initializing the manager to pass it in as the manager needs it for the cache configuration.
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes