Repository navigation
Conversation
BindPod only added a pod's requests the first time it was bound, and DeletePod subtracted whatever the pod requested at deletion time. After an in-place resize the usage kept the old value, and deleting the pod then left the node usage off by the difference (it could go negative). Track the requests counted for each bound pod and use them when the pod is re-bound or deleted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a pod that is already bound gets updated with different requests (for example an in-place resize), the node usage isn't updated.
BindPodonly adds requests the first time a pod is bound, andDeletePodsubtracts the pod's current requests. So after a resize from 1 to 3 CPU the node keeps showing 1 CPU used, and after the pod is deleted it shows -2 CPU.This keeps the requests that were counted for each bound pod and uses them when the pod is bound again or deleted.
Added
TestClusterUpdatePodRequests, which fails on main (expected 3 CPU used after the update, got 1/got -2after delete).go test ./pkg/...andgo vetpass.