-
Notifications
You must be signed in to change notification settings - Fork 88
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
feat: Use custom cache function in Che Operator #1166
Conversation
What about this label? |
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.
No real issues on my end but I don't have a deep insight into how the Che operator works.
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
…work migration. Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
New changes are detected. LGTM label has been removed. |
Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
@mmorhun: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What does this PR do?
This PR introduces custom cache function for the default k8s client of the Operator. This is required, because default cache function caches every object of the kind cluster-wide that the Operator ever reads. Such behavior ends up in a huge memory usage on a cluster with many resources. Consequently, the Operator is terminated by OOM.
However, Operator's controller runtime has own restrictions on the cache function: every kind of k8s object is limited to a single selector that is used to detect if specific object should be cached. In turn, a selector cannot have or condition in it. And that's the price we have to pay: all k8s objects that are handled by the default Operator client should have a label (or set of them) set. Otherwise, Che Operator will not see the objects at all (unless a separate slow client is used).
After this PR is merged all k8s resources that Che Operator interacts with must have
app.kubernetes.io/part-of=che.eclipse.org
label.The requirement above is also applicable to the user defined configurations in Config Maps and Secrets (such as custom TLS certificates, etc.). To not to break existing installations, Che Operator will search for such objects on its start and add the required label. This way existing deployments of Che will not be broken.
Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
Resolves: eclipse-che/che#20647
Depends on: che-dockerfiles/che-tls-secret-creator#6
How to test this PR?
256Mi
for i in {1..500}; do oc create namespace test$i; done
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.