Skip to content

perf: strip data fields from all ConfigMaps except operator configs#2677

Merged
simar7 merged 1 commit intoaquasecurity:mainfrom
vyaktigat99:omitConfigMapData
Jul 31, 2025
Merged

perf: strip data fields from all ConfigMaps except operator configs#2677
simar7 merged 1 commit intoaquasecurity:mainfrom
vyaktigat99:omitConfigMapData

Conversation

@mjshastha
Copy link
Copy Markdown
Contributor

@mjshastha mjshastha commented Jul 30, 2025

To reduce memory usage and avoid operator restarts due to large ConfigMap objects, this change disables caching of data and binaryData fields for all ConfigMaps except trivy-operator-policies-config and trivy-operator-trivy-config.

Fixes: #2541

To reduce memory usage and avoid operator restarts due to large ConfigMap objects,
this change disables caching of `data` and `binaryData` fields for all ConfigMaps
except `trivy-operator-policies-config` and `trivy-operator-trivy-config`.
@mjshastha mjshastha requested a review from simar7 as a code owner July 30, 2025 08:16
Copy link
Copy Markdown
Member

@simar7 simar7 left a comment

Choose a reason for hiding this comment

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

LGTM, I have verified the results independently with these changes using a small PoC https://github.com/simar7/k8s-informer-poc

@simar7
Copy link
Copy Markdown
Member

simar7 commented Jul 30, 2025

@afdesk could you also take another look?

Copy link
Copy Markdown
Contributor

@afdesk afdesk left a comment

Choose a reason for hiding this comment

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

LGTM!
I played with this change, it works correctly:

$ helm install trivy-operator aquasecurity/trivy-operator --create-namespace --namespace trivy-system \ 
   --set image.repository=afdesk/trivy-operator --set image.tag=2677 \
   --set trivy.resources.limits.memory=1Gi

@afdesk
Copy link
Copy Markdown
Contributor

afdesk commented Jul 30, 2025

this PR fixes #2541, right?

@simar7 simar7 merged commit 8825031 into aquasecurity:main Jul 31, 2025
9 checks passed
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.

Trivy-operator restart when handling large volumes of data.

3 participants