diff --git a/config/crd/bases/config.katalyst.kubewharf.io_transparentmemoryoffloadingconfigurations.yaml b/config/crd/bases/config.katalyst.kubewharf.io_transparentmemoryoffloadingconfigurations.yaml index 1e61097d..6c82897a 100644 --- a/config/crd/bases/config.katalyst.kubewharf.io_transparentmemoryoffloadingconfigurations.yaml +++ b/config/crd/bases/config.katalyst.kubewharf.io_transparentmemoryoffloadingconfigurations.yaml @@ -223,6 +223,76 @@ spec: type: object type: array type: object + poolNameConfig: + description: PoolNameConfig is a configuration for manipulating + TMO on specified resource pools + items: + properties: + configDetail: + description: ConfigDetail is configuration details of TMO + properties: + enableSwap: + description: EnableSwap is whether to enable swap to + offloading anon pages + type: boolean + enableTMO: + description: EnableTMO is whether to enable TMO on target + objective + type: boolean + interval: + description: Interval is the minimum duration the objectives + got memory reclaimed by TMO + type: string + policyName: + description: PolicyName is used to specify the policy + for calculating memory offloading size + type: string + psiPolicy: + description: PSIPolicyConf is configurations of a TMO + policy which reclaim memory by PSI + properties: + maxProbe: + description: MaxProbe limits the memory offloading + size in one cycle, it's a ratio of memory usage. + type: number + psiAvg60Threshold: + description: |- + PSIAvg60Threshold indicates the threshold of memory pressure. If observed pressure exceeds + this threshold, memory offloading will be paused. + type: number + type: object + refaultPolicy: + description: RefaultPolicy is configurations of a TMO + policy which reclaim memory by refault + properties: + maxProbe: + description: MaxProbe limits the memory offloading + size in one cycle, it's a ratio of memory usage. + type: number + reclaimAccuracyTarget: + description: ReclaimAccuracyTarget indicates the + desired level of precision or accuracy in offloaded + pages. + type: number + reclaimScanEfficiencyTarget: + description: |- + ReclaimScanEfficiencyTarget indicates the desired level of efficiency in scanning and + identifying memory pages that can be offloaded. + type: number + type: object + type: object + poolName: + description: PoolName is a resource pool name, e.g. system, + shared, reclaimed + type: string + required: + - configDetail + - poolName + type: object + type: array + x-kubernetes-list-map-keys: + - poolName + x-kubernetes-list-type: map qosLevelConfig: description: QoSLevelConfig is a configuration for manipulating TMO on Different QoS Level diff --git a/pkg/apis/config/v1alpha1/tmo.go b/pkg/apis/config/v1alpha1/tmo.go index 562b17c8..2623e21a 100644 --- a/pkg/apis/config/v1alpha1/tmo.go +++ b/pkg/apis/config/v1alpha1/tmo.go @@ -79,6 +79,12 @@ type TransparentMemoryOffloadingConfig struct { // +listType=map CgroupConfig []CgroupConfig `json:"CgroupConfig,omitempty"` + // PoolNameConfig is a configuration for manipulating TMO on specified resource pools + // +optional + // +listMapKey=poolName + // +listType=map + PoolNameConfig []PoolNameConfig `json:"poolNameConfig,omitempty"` + // BlockConfig is a configuration for blocking tmo on specified pods. // +optional BlockConfig *BlockConfig `json:"blockConfig,omitempty"` @@ -100,6 +106,14 @@ type CgroupConfig struct { ConfigDetail TMOConfigDetail `json:"configDetail"` } +type PoolNameConfig struct { + // PoolName is a resource pool name, e.g. system, shared, reclaimed + PoolName string `json:"poolName"` + + // ConfigDetail is configuration details of TMO + ConfigDetail TMOConfigDetail `json:"configDetail"` +} + type TMOConfigDetail struct { // EnableTMO is whether to enable TMO on target objective // +optional diff --git a/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go index 2e1790c2..0d502f6d 100644 --- a/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -2218,6 +2218,23 @@ func (in *PolicyRule) DeepCopy() *PolicyRule { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PoolNameConfig) DeepCopyInto(out *PoolNameConfig) { + *out = *in + in.ConfigDetail.DeepCopyInto(&out.ConfigDetail) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolNameConfig. +func (in *PoolNameConfig) DeepCopy() *PoolNameConfig { + if in == nil { + return nil + } + out := new(PoolNameConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PriorityNodeLabelSelectorAllowedKeyList) DeepCopyInto(out *PriorityNodeLabelSelectorAllowedKeyList) { *out = *in @@ -3164,6 +3181,13 @@ func (in *TransparentMemoryOffloadingConfig) DeepCopyInto(out *TransparentMemory (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.PoolNameConfig != nil { + in, out := &in.PoolNameConfig, &out.PoolNameConfig + *out = make([]PoolNameConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.BlockConfig != nil { in, out := &in.BlockConfig, &out.BlockConfig *out = new(BlockConfig)