Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit 955d1dd

Browse files
feat(crd): Update Recommendation spec with resource strategy constraints (#307)
1 parent 2f7210c commit 955d1dd

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

internal/services/controller/crd/generated.deepcopy.go

Lines changed: 57 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/services/controller/crd/recommendation_types.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,35 @@ type ResourceStrategyType string
3434

3535
const ResourceStrategyTypeNodeAllocatablePercentage ResourceStrategyType = "NodeAllocatablePercentage"
3636

37+
// ResourceMinMax defines optional min/max bounds for a single resource.
38+
type ResourceMinMax struct {
39+
// Min is the lower bound for requests.
40+
// +optional
41+
Min *resource.Quantity `json:"min,omitempty"`
42+
// Max is the upper bound for requests.
43+
// +optional
44+
Max *resource.Quantity `json:"max,omitempty"`
45+
}
46+
47+
// ResourceConstraints defines optional per-resource min/max bounds for requests.
48+
type ResourceConstraints struct {
49+
// +optional
50+
CPU *ResourceMinMax `json:"cpu,omitempty"`
51+
// +optional
52+
Memory *ResourceMinMax `json:"memory,omitempty"`
53+
}
54+
3755
// ResourceStrategy selects a strategy for dynamic resource sizing.
3856
type ResourceStrategy struct {
3957
Type ResourceStrategyType `json:"type"`
4058

4159
// +optional
4260
NodeAllocatablePercentage *NodeAllocatablePercentage `json:"nodeAllocatablePercentage,omitempty"`
61+
62+
// Constraints define optional min/max bounds for dynamically resolved requests.
63+
// When present, resolved requests are clamped to [min, max].
64+
// +optional
65+
Constraints *ResourceConstraints `json:"constraints,omitempty"`
4366
}
4467

4568
// NodeAllocatablePercentage represents the node allocatable percentage configuration.

0 commit comments

Comments
 (0)