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

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

Operator now applies default resource limits to tekton-pruner-controller (2Gi memory) and tekton-pruner-webhook (512Mi memory) based on benchmark data. CPU limits omitted to avoid throttling. Override via TektonConfig.spec.tektonpruner.options.deployments if needed.

@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Sep 9, 2026
@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 27.60%. Comparing base (a951115) to head (d9e55fe).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4066      +/-   ##
==========================================
- Coverage   27.66%   27.60%   -0.06%     
==========================================
  Files         477      477              
  Lines       25469    25524      +55     
==========================================
  Hits         7046     7046              
- Misses      17699    17754      +55     
  Partials      724      724              
Flag Coverage Δ
unit-tests 27.60% <ø> (-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
Comment thread pkg/reconciler/kubernetes/tektonpruner/transform.go Outdated
@pratap0007

Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2026
@jkhelil

jkhelil commented Sep 16, 2026

Copy link
Copy Markdown
Member

@infernus01 Please addd release note

Signed-off-by: Shubham Bhardwaj <shubbhar@redhat.com>
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 18, 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 ask for approval from pratap0007 after the PR has been reviewed.

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 release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesnt merit a release note. labels Sep 18, 2026
@pratap0007

Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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