Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Limit objects cached by DevWorkspace controller to reduce memory usage #652
Limit objects cached by DevWorkspace controller to reduce memory usage #652
Changes from 1 commit
3d3732d
d6a12b1
1b2d3b7
4e4e5b3
1b4a7e0
0008111
2130ef1
43aae00
465405e
8290933
299186d
76d43d7
6c83e0a
8e07871
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I wonder if we need a dedicated label for each of objects type?
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.
WDYM? For most objects, the
devworkspace_id
label is sufficient, but I had to add separate ones for configmaps/secrets since those by default do not have one label they always use. We might run into a similar issue to workaround for Deployments if we continue supportingasync
storage, but we could fudge that by usingdevworkspace_id: all
or something.We could use one label for both secrets and configmaps, but then we run into the issue of how to name it --
watch-resource
may be unclear as it only applies to configmaps/secrets, and we use different labels for other objects.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.
I think you got my question)
That's exactly what I have in mind, including the concern ) So, then I think it makes sense to leave as is.
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.
One tiny +1 to use common watch annotation - it will allow us to avoid having different articles/section to some docs, like here https://docs.google.com/document/d/1IR78XlxO37VTWXOu-uE-2nKC93D1GNhZomGoRaN518o/edit?usp=sharing
So, we'll just provide a single patch command instead two.
The concern:
may be addressed by the following explanation:
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.
I assume that there always is at least some kind of label on the secret/configmap that DWO handles, even if such labels differ depending on the purpose.
I think (I have not tried this out), it should be possible to write an "OR" label selector - if not using the existing code then by implementing a custom
labels.Selector
.I personally think requiring 2 labels on a single object for a single purpose is a little bit weird from the UX perspective.
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.
an "or" selector is apparently impossible, so please ignore me :)
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.
The reality is that there are multiple labels that can get applied to configmaps or secrets, and they each serve a different purpose
controller.devfile.io/watch-[secret|configmap]
: mark this secret/configmap as "of interest" to the controller; necessary due to caching changecontroller.devfile.io/mount-to-devworkspace
: mount this resource to the workspace; used by external tools/users to share info across multiple workspacescontroller.devfile.io/git-credential
: mark a secret as holding git credentials, which is handled differently from abovecontroller.devfile.io/devworkspace_id
: associate this resource with the workspace with workspace ID specified.Cases 2, 3 and 4 can exist independently of each other, e.g. a user-defined mounted configmap won't have the
devworkspace_id
label, and the metadata configmap we provision for workspaces won't have themount-to-devworkspace
label. As a result, there's no label selector we can use here, so we have to add thewatch
label to cover all use cases. Moreover, there will be cases when there are secrets/configmaps on the cluster that we're interested in that only have thecontroller.devfile.io/watch-[secret|configmap]
label and no others.Potentially, but it's still somewhat unclear: we watch PVCs without the label applied, and secrets/configmaps become invisible if the label is removed, even if it has the workspace ID label. I'm open to using one label for both, but I'm not sure it's a huge gain in documentation burden.