Skip to content
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

tmo block list support dynamic config #98

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,73 @@ spec:
x-kubernetes-list-map-keys:
- cgroupPath
x-kubernetes-list-type: map
blockConfig:
description: BlockConfig is a configuration for blocking tmo on
specified pods.
properties:
annotations:
description: Annotations indicates disable tmo if pods with
these annotations. The requirements are ORed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If
the operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced
during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
labels:
description: Labels indicates disable tmo if pods with these
labels. The requirements are ORed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If
the operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced
during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
qosLevelConfig:
description: QoSLevelConfig is a configuration for manipulating
TMO on Different QoS Level
Expand Down
19 changes: 17 additions & 2 deletions pkg/apis/config/v1alpha1/tmo.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ type TransparentMemoryOffloadingConfig struct {
// +listMapKey=cgroupPath
// +listType=map
CgroupConfig []CgroupConfig `json:"CgroupConfig,omitempty"`

// BlockConfig is a configuration for blocking tmo on specified pods.
// +optional
BlockConfig *BlockConfig `json:"blockConfig,omitempty"`
}

type QoSLevelConfig struct {
Expand Down Expand Up @@ -120,8 +124,9 @@ type TMOConfigDetail struct {
type TMOPolicyName string

const (
TMOPolicyNamePSI TMOPolicyName = "PSI"
TMOPolicyNameRefault TMOPolicyName = "Refault"
TMOPolicyNamePSI TMOPolicyName = "PSI"
TMOPolicyNameRefault TMOPolicyName = "Refault"
TMOPolicyNameIntegrated TMOPolicyName = "Integrated"
)

type PSIPolicyConf struct {
Expand All @@ -143,6 +148,16 @@ type RefaultPolicyConf struct {
ReclaimScanEfficiencyTarget *float64 `json:"reclaimScanEfficiencyTarget,omitempty"`
}

type BlockConfig struct {
// Labels indicates disable tmo if pods with these labels. The requirements are ORed.
// +optional
Labels []metav1.LabelSelectorRequirement `json:"labels,omitempty"`

// Annotations indicates disable tmo if pods with these annotations. The requirements are ORed.
// +optional
Annotations []metav1.LabelSelectorRequirement `json:"annotations,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// TransparentMemoryOffloadingIndicators is indicator for transparent memory offloading
type TransparentMemoryOffloadingIndicators struct {
Expand Down
35 changes: 35 additions & 0 deletions pkg/apis/config/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading