@@ -40,7 +40,7 @@ type PodQOSSpec struct {
4040 // ResourceQOS describe the QOS limit for cpu,memory,netIO,diskIO and so on.
4141 ResourceQOS ResourceQOS `json:"resourceQOS,omitempty"`
4242
43- //QualityProbe defines the way to probe a pod
43+ // QualityProbe defines the way to probe a pod
4444 PodQualityProbe PodQualityProbe `json:"podQualityProbe,omitempty"`
4545
4646 // AllowedActions limits the set of actions that the pods is allowed to perform by NodeQOS
@@ -96,6 +96,43 @@ type ResourceQOS struct {
9696 DiskIOQOS * DiskIOQOS `json:"diskIOQOS,omitempty"`
9797}
9898
99+ // CompressionPreference provides a quick way to set the frequency, ratio and size of compression.
100+ type CompressionPreference string
101+
102+ type CompressionOversold string
103+
104+ const (
105+ PreferenceTiny CompressionPreference = "Tiny"
106+ PreferenceNormal CompressionPreference = "Normal"
107+ PreferenceFileOnly CompressionPreference = "FileOnly"
108+ PreferenceAnonOnly CompressionPreference = "AnonOnly"
109+
110+ OversoldTransparent CompressionOversold = "Transparent"
111+ OversoldNone CompressionOversold = "None"
112+ OversoldAllow CompressionOversold = "Allow"
113+ )
114+
115+ type MemoryCompression struct {
116+ // +kubebuilder:validation:Default=false
117+ Enable bool `json:"enable,omitempty"`
118+
119+ // +kubebuilder:validation:Minimum=0
120+ // +kubebuilder:validation:Maximum=4
121+ CompressionLevel int `json:"compressionLevel,omitempty"`
122+
123+ // +kubebuilder:validation:Type=string
124+ // +kubebuilder:validation:Enum=Tiny;Normal;FileOnly;AnonOnly
125+ // +kubebuilder:default=Tiny
126+ // +optional
127+ Preference CompressionPreference `json:"preference"`
128+
129+ // +kubebuilder:validation:Type=string
130+ // +kubebuilder:validation:Enum=Transparent;None;Allow
131+ // +kubebuilder:default=Allow
132+ // +optional
133+ Oversold CompressionOversold `json:"oversold"`
134+ }
135+
99136type CPUQOS struct {
100137 // CPUPriority define the cpu priority for the pods.
101138 // CPUPriority range [0,7], 0 is the highest level.
@@ -155,6 +192,8 @@ type MemoryQOS struct {
155192 MemAsyncReclaim MemAsyncReclaim `json:"memAsyncReclaim,omitempty"`
156193 MemWatermark MemWatermark `json:"memWatermark,omitempty"`
157194 MemPageCacheLimit MemPageCacheLimit `json:"memPageCacheLimit,omitempty"`
195+
196+ MemoryCompression MemoryCompression `json:"memoryCompression,omitempty"`
158197}
159198
160199type MemPageCacheLimit struct {
@@ -258,10 +297,17 @@ type NodeQOSSpec struct {
258297 // MemoryLimit is the mem limit in the node
259298 MemoryLimit MemLimit `json:"memLimit,omitempty"`
260299
300+ MemoryCompression NodeMemoryCompression `json:"memoryCompression,omitempty"`
301+
261302 // NetLimits is the net IO limit in the node
262303 NetLimits NetLimits `json:"netLimits,omitempty"`
263304}
264305
306+ type NodeMemoryCompression struct {
307+ // +kubebuilder:validation:Default=false
308+ Enable bool `json:"enable,omitempty"`
309+ }
310+
265311type NetLimits struct {
266312 RXBpsMin * int64 `json:"rxBpsMin"`
267313 RXBpsMax * int64 `json:"rxBpsMax"`
@@ -402,7 +448,7 @@ type AvoidanceActionSpec struct {
402448 // +optional
403449 Throttle * ThrottleAction `json:"throttle,omitempty"`
404450
405- //Eviction describes the eviction action
451+ // Eviction describes the eviction action
406452 // +optional
407453 Eviction * EvictionAction `json:"eviction,omitempty"`
408454
0 commit comments