Uh oh!
There was an error while loading. Please reload this page.
Limit objects cached in webhooks manager - #889
Conversation
ibuziuk
commented
Jul 6, 2022
/retest |
1 similar comment
ibuziuk
commented
Jul 6, 2022
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk, ibuziuk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
When validating pods/exec requests, due to how Kubernetes serves webhook requests, the webhook server has to read the pod being execed into from the cluster. Since it does this using the manager, it's possible for the manager's internal cache to grow too large for the default webhook server memory limit, causing it to be killed. If this occurs, the cluster is left in a bad state until either the number of pods on the cluster is reduced or the webhooks server memory limit is increased. This PR adds a cache filter similar to the main controller to limit which pods the webhook server caches. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
New changes are detected. LGTM label has been removed. |
amisevsk
commented
Jul 6, 2022
CI actually caught an error for once -- earlier this PR was filtering to pods that had the I've verified this PR in the following way:
In the Testing with image N.B. if you are testing this, it's necessary to run |
For some reason, it's possible to edit a pod controlled by a replicaset to use a different image, and that change will not be reverted by the replicaset. We don't want to allow this for restricted-access pods, as it could potentially allow someone to silently replace the image used for a workspace pod. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
amisevsk
commented
Jul 6, 2022
Found another minor issue (unrelated to this PR but a simple fix): it's possible to update the image for containers/initContainers in a pod, and this change is apparently not reverted by replicasets. I've added a check to the webhook server for restricted-access workspaces. |
What does this PR do?
Similarly to #652, limit pods cached by the webhook server to be only those with the
controller.devfile.io/devworkspace_idlabel. This prevents the webhook server from mirroring all pods on the cluster to memory, causing memory usage to increase when there is a large number of pods in the cluster.What issues does this PR fix or reference?
Closes#888
Is it tested? How?
PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-pathto trigger)v8-devworkspace-operator-e2e: DevWorkspace e2e testv8-che-happy-path: Happy path for verification integration with Che