-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat: add evictAfterOOMThreshold per vpa #9071
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
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: omerap12 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 |
|
/hold |
soltysh
left a comment
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.
Initial comments from API shadow
| // +kubebuilder:validation:Type=string | ||
| // +kubebuilder:validation:Format=duration | ||
| // +kubebuilder:validation:Pattern=`^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$` | ||
| EvictAfterOOMThreshold *metav1.Duration `json:"evictAfterOOMThreshold,omitempty" protobuf:"bytes,4,opt,name=evictAfterOOMThreshold"` |
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 don't think we have any metav1.Duration in the k/k APIs, and from a quick grep it seems we don't have them in this repo. So I'd suggest to stick with the usual units as described here https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#units. Example EvictAfterOOMSeconds or something like that.
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've added noduration to kube-api-linter: #9147
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 don't know if this matters, but, this field is an override to the --evict-after-oom-threshold flag, which is currently a duration:
autoscaler/vertical-pod-autoscaler/pkg/updater/priority/update_priority_calculator.go
Lines 41 to 43 in e8fe343
| evictAfterOOMThreshold = flag.Duration("evict-after-oom-threshold", 10*time.Minute, | |
| `Evict pod that has OOMed in less than evict-after-oom-threshold since start.`) | |
| ) |
Keeping the flag and API constant feels like a nice thing to do, but I'm assuming the reason listed in the api-conventions doc is higher priority:
We don't use Duration in the API since that would require clients to implement go-compatible parsing.
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.
Thanks Maciej (again) :)
@adrianmoisey , so let's go with EvictAfterOOMSeconds? I will update the AEP and this PR if that's ok with you.
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
1ddfd7b to
cb9dc87
Compare
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: