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

koordlet: support NetworkQoS plugin #1843

Merged
merged 1 commit into from
Mar 4, 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
4 changes: 4 additions & 0 deletions apis/extension/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const (
// LabelPodMutatingUpdate is a label key that pods with `pod.koordinator.sh/mutating-update=true` will
// be mutated by Koordinator webhook when updating.
LabelPodMutatingUpdate = PodDomainPrefix + "/mutating-update"

// AnnotationNetworkQOS are used to set bandwidth for Pod. The unit is bps.
// For example, 10M means 10 megabits per second.
AnnotationNetworkQOS = DomainPrefix + "networkQOS"
)

type AggregationType string
Expand Down
12 changes: 12 additions & 0 deletions apis/slo/v1alpha1/nodeslo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ const (
CPUQOSPolicyCoreSched CPUQOSPolicy = "coreSched"
)

type NETQOSPolicy string

const (
// NETQOSPolicyTC indicates implement netqos by tc.
NETQOSPolicyTC NETQOSPolicy = "tc"
// NETQOSPolicyTerwayQos indicates implement netqos by terway-qos.
NETQOSPolicyTerwayQos NETQOSPolicy = "terway-qos"
)

// MemoryQOS enables memory qos features.
type MemoryQOS struct {
// memcg qos
Expand Down Expand Up @@ -243,6 +252,9 @@ type NetworkQOS struct {
type ResourceQOSPolicies struct {
// applied policy for the CPU QoS, default = "groupIdentity"
CPUPolicy *CPUQOSPolicy `json:"cpuPolicy,omitempty"`

// applied policy for the Net QoS, default = "tc"
NETQOSPolicy *NETQOSPolicy `json:"netQOSPolicy,omitempty"`
}

type ResourceQOSStrategy struct {
Expand Down
5 changes: 5 additions & 0 deletions apis/slo/v1alpha1/zz_generated.deepcopy.go

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

3 changes: 3 additions & 0 deletions config/crd/bases/slo.koordinator.sh_nodeslos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,9 @@ spec:
cpuPolicy:
description: applied policy for the CPU QoS, default = "groupIdentity"
type: string
netQOSPolicy:
description: applied policy for the Net QoS, default = "tc"
type: string
type: object
systemClass:
description: ResourceQOS for system pods
Expand Down
8 changes: 8 additions & 0 deletions pkg/koordlet/runtimehooks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/koordinator-sh/koordinator/pkg/koordlet/runtimehooks/hooks/cpuset"
"github.com/koordinator-sh/koordinator/pkg/koordlet/runtimehooks/hooks/gpu"
"github.com/koordinator-sh/koordinator/pkg/koordlet/runtimehooks/hooks/groupidentity"
"github.com/koordinator-sh/koordinator/pkg/koordlet/runtimehooks/hooks/terwayqos"
"github.com/koordinator-sh/koordinator/pkg/koordlet/util/system"
)

Expand Down Expand Up @@ -73,6 +74,11 @@ const (
// owner: @saintube @zwzhang0107
// alpha: v1.4
CoreSched featuregate.Feature = "CoreSched"

// TerwayQoS enables net QoS feature of koordlet.
// owner: @l1b0k
// alpha: v1.5
TerwayQoS featuregate.Feature = "TerwayQoS"
zwzhang0107 marked this conversation as resolved.
Show resolved Hide resolved
)

var (
Expand All @@ -83,6 +89,7 @@ var (
BatchResource: {Default: true, PreRelease: featuregate.Beta},
CPUNormalization: {Default: false, PreRelease: featuregate.Alpha},
CoreSched: {Default: false, PreRelease: featuregate.Alpha},
TerwayQoS: {Default: false, PreRelease: featuregate.Alpha},
}

runtimeHookPlugins = map[featuregate.Feature]HookPlugin{
Expand All @@ -92,6 +99,7 @@ var (
BatchResource: batchresource.Object(),
CPUNormalization: cpunormalization.Object(),
CoreSched: coresched.Object(),
TerwayQoS: terwayqos.Object(),
}
)

Expand Down
Loading
Loading