Skip to content
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

restrict manager resource cache based on namespaces from environment #186

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leelavg
Copy link
Contributor

@leelavg leelavg commented Dec 11, 2024

always cache resources from operator deployed namespace and provider an option to user for caching resources from other namespaces via WATCH_NAMESPACE env var with a comma separated namespace values.

fixes: #184

@leelavg
Copy link
Contributor Author

leelavg commented Dec 11, 2024

tested, peak usage was 50 Mi for startup down from ~ 1.5 Gi on a semi-prod cluster.

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Dec 11, 2024

The namespace(s) name needs to be configurable as this operator is developed to work with multiple namespaces

https://sdk.operatorframework.io/docs/building-operators/golang/operator-scope/#configuring-watch-namespaces-dynamically is the way we need to look to fix this one.

@leelavg
Copy link
Contributor Author

leelavg commented Dec 11, 2024

Yes, I want to refactor when we actually need it and so reused operator namespace.

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Dec 11, 2024

Yes, I want to refactor when we actually need it and so reused operator namespace.

IMO, it should be implemented in the above-requested manner instead of immediately changing it and later refactoring it. @nb-ohad WDYT?

@leelavg leelavg changed the title restrict manager resource cache to only operator namespace restrict manager resource cache based on namespaces from environment Dec 11, 2024
@leelavg
Copy link
Contributor Author

leelavg commented Dec 11, 2024

The namespace(s) name needs to be configurable as this operator is developed to work with multiple namespaces

https://sdk.operatorframework.io/docs/building-operators/golang/operator-scope/#configuring-watch-namespaces-dynamically is the way we need to look to fix this one.

  • multi namespace is not working, need to go through controller-runtime code on what changed.

@leelavg leelavg force-pushed the oom-fix branch 2 times, most recently from 37772c2 to e69eb50 Compare December 19, 2024 04:04
@leelavg
Copy link
Contributor Author

leelavg commented Dec 19, 2024

done.

@leelavg
Copy link
Contributor Author

leelavg commented Dec 19, 2024

/assign @nb-ohad @Madhu-1

always cache resources from operator deployed namespace and provider an
option to user for caching resources from other namespaces via
`WATCH_NAMESPACE` env var with a comma separated namespace values.

Signed-off-by: Leela Venkaiah G <[email protected]>
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.

High memory usage due to watching all namespaces
2 participants