diff --git a/config/crd/bases/config.katalyst.kubewharf.io_transparentmemoryoffloadingconfigurations.yaml b/config/crd/bases/config.katalyst.kubewharf.io_transparentmemoryoffloadingconfigurations.yaml index 8b90fb66..8a05d03c 100644 --- a/config/crd/bases/config.katalyst.kubewharf.io_transparentmemoryoffloadingconfigurations.yaml +++ b/config/crd/bases/config.katalyst.kubewharf.io_transparentmemoryoffloadingconfigurations.yaml @@ -110,6 +110,15 @@ spec: description: Interval is the minimum duration the objectives got memory reclaimed by TMO type: string + maxReclaimSize: + anyOf: + - type: integer + - type: string + description: MaxReclaimSize is a Kubernetes resource + quantity that limits the size that can be reclaimed + in one TMO cycle. Zero means unlimited. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true policyName: description: PolicyName is used to specify the policy for calculating memory offloading size @@ -248,6 +257,15 @@ spec: description: Interval is the minimum duration the objectives got memory reclaimed by TMO type: string + maxReclaimSize: + anyOf: + - type: integer + - type: string + description: MaxReclaimSize is a Kubernetes resource + quantity that limits the size that can be reclaimed + in one TMO cycle. Zero means unlimited. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true policyName: description: PolicyName is used to specify the policy for calculating memory offloading size @@ -323,6 +341,15 @@ spec: description: Interval is the minimum duration the objectives got memory reclaimed by TMO type: string + maxReclaimSize: + anyOf: + - type: integer + - type: string + description: MaxReclaimSize is a Kubernetes resource + quantity that limits the size that can be reclaimed + in one TMO cycle. Zero means unlimited. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true policyName: description: PolicyName is used to specify the policy for calculating memory offloading size diff --git a/pkg/apis/config/v1alpha1/tmo.go b/pkg/apis/config/v1alpha1/tmo.go index 14177b52..f74fae35 100644 --- a/pkg/apis/config/v1alpha1/tmo.go +++ b/pkg/apis/config/v1alpha1/tmo.go @@ -17,8 +17,10 @@ limitations under the License. package v1alpha1 import ( - "github.com/kubewharf/katalyst-api/pkg/consts" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/kubewharf/katalyst-api/pkg/consts" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -135,6 +137,10 @@ type TMOConfigDetail struct { // +optional PolicyName *TMOPolicyName `json:"policyName,omitempty"` + // MaxReclaimSize is a Kubernetes resource quantity that limits the size that can be reclaimed in one TMO cycle. Zero means unlimited. + // +optional + MaxReclaimSize *resource.Quantity `json:"maxReclaimSize,omitempty"` + // PSIPolicyConf is configurations of a TMO policy which reclaim memory by PSI // +optional PSIPolicyConf *PSIPolicyConf `json:"psiPolicy,omitempty"` diff --git a/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go index 6dd646ef..f56803f9 100644 --- a/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -3223,6 +3223,11 @@ func (in *TMOConfigDetail) DeepCopyInto(out *TMOConfigDetail) { *out = new(TMOPolicyName) **out = **in } + if in.MaxReclaimSize != nil { + in, out := &in.MaxReclaimSize, &out.MaxReclaimSize + x := (*in).DeepCopy() + *out = &x + } if in.PSIPolicyConf != nil { in, out := &in.PSIPolicyConf, &out.PSIPolicyConf *out = new(PSIPolicyConf)