Skip to content

feat(pruner): add default resource limits to controller and webhook - #4066

Open
infernus01 wants to merge 1 commit into
tektoncd:mainfrom
infernus01:fix/pruner-limits
Open

feat(pruner): add default resource limits to controller and webhook#4066
infernus01 wants to merge 1 commit into
tektoncd:mainfrom
infernus01:fix/pruner-limits

Conversation

@infernus01

@infernus01 infernus01 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

Adds default resource requests and limits for tekton-pruner-controller and tekton-pruner-webhook deployments in the operator.

Changes

Modified pkg/reconciler/kubernetes/tektonpruner/transform.go to include a new addDefaultResourceLimits() transformer that injects default
resource specifications:

tekton-pruner-controller

resources:
  requests:
    cpu: 100m
    memory: 256Mi
  limits:
    cpu: 500m
    memory: 2Gi

tekton-pruner-webhook

  resources:
    requests:
      cpu: 50m
      memory: 64Mi
    limits:
      cpu: 250m
      memory: 128Mi

Rationale

Benchmark data: Testing showed the pruner controller uses 846-1126 MB heap memory when tracking 26k-38k resident PipelineRuns in its informer cache.

Override Mechanism

These defaults can be overridden via TektonConfig or TektonPruner CR:

  apiVersion: operator.tekton.dev/v1alpha1
  kind: TektonConfig
  spec:
    pruner:
      options:
        deployments:
        - name: tekton-pruner-controller
          spec:
            template:
              spec:
                containers:
                - name: controller
                  resources:
                    limits:
                      memory: 4Gi  # Override default

The transformer runs before the options transformer, so user-specified values take precedence.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

NONE

@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Sep 9, 2026
@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign pramodbindal after the PR has been reviewed.
You can assign the PR to them by writing /assign @pramodbindal in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 9, 2026
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 26.89%. Comparing base (f09782c) to head (ff5b47f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4066      +/-   ##
==========================================
- Coverage   26.95%   26.89%   -0.06%     
==========================================
  Files         467      467              
  Lines       25170    25225      +55     
==========================================
  Hits         6785     6785              
- Misses      17648    17703      +55     
  Partials      737      737              
Flag Coverage Δ
unit-tests 26.89% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/reconciler/kubernetes/tektonpruner/transform.go Outdated
Comment thread pkg/reconciler/kubernetes/tektonpruner/transform.go Outdated
return err
}

for i := range sts.Spec.Template.Spec.Containers {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please move this entire loop into a common function?

Signed-off-by: Shubham Bhardwaj <shubbhar@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants