Skip to content

Commit

Permalink
docs: support NetworkQoS based on external plugin such as terway-qos
Browse files Browse the repository at this point in the history
Signed-off-by: lucming <2876757716@qq.com>
  • Loading branch information
lucming committed Dec 25, 2023
1 parent 688cdd3 commit 3a9db05
Show file tree
Hide file tree
Showing 7 changed files with 720 additions and 28 deletions.
31 changes: 31 additions & 0 deletions apis/slo/v1alpha1/nodeslo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ limitations under the License.
package v1alpha1

import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
Expand Down Expand Up @@ -202,6 +204,32 @@ type ResourceQOS struct {
MemoryQOS *MemoryQOSCfg `json:"memoryQOS,omitempty"`
BlkIOQOS *BlkIOQOSCfg `json:"blkioQOS,omitempty"`
ResctrlQOS *ResctrlQOSCfg `json:"resctrlQOS,omitempty"`
NetworkQOS *NetworkQOSCfg `json:"networkQOS,omitempty"`
}

type NetworkQOSCfg struct {
Enable *bool `json:"enable,omitempty"`
NetworkQOS `json:",inline"`
}

type NetworkQOS struct {
// IngressRequest describes the minimum percentage of network bandwidth guaranteed in the ingress direction.
// bps(bytes per second), valid in 0%-100%
// +kubebuilder:default="0%"
IngressRequest *intstr.IntOrString `json:"ingressRequest,omitempty"`
// IngressLimit describes the maximum percentage of network bandwidth can be used in the ingress direction,
// bps(bytes per seconds), valid in 0%-100%
// +kubebuilder:default="100%"
IngressLimit *intstr.IntOrString `json:"ingressLimit,omitempty"`

// EgressRequest describes the minimum percentage of network bandwidth guaranteed in the egress direction.
// bps(bytes per second), valid in 0%-100%
// +kubebuilder:default="0%"
EgressRequest *intstr.IntOrString `json:"egressRequest,omitempty"`
// EgressLimit describes the maximum percentage of network bandwidth can be used in the egress direction,
// bps(bytes per seconds), validate in 0%-100%
// +kubebuilder:default="100%"
EgressLimit *intstr.IntOrString `json:"egressLimit,omitempty"`
}

type ResourceQOSPolicies struct {
Expand Down Expand Up @@ -340,6 +368,9 @@ type SystemStrategy struct {
WatermarkScaleFactor *int64 `json:"watermarkScaleFactor,omitempty" validate:"omitempty,gt=0,max=400"`
// /sys/kernel/mm/memcg_reaper/reap_background
MemcgReapBackGround *int64 `json:"memcgReapBackGround,omitempty" validate:"omitempty,min=0,max=1"`

// TotalNetworkBandwidth indicates the overall network bandwidth, cluster manager can set this field, and default value taken from /sys/class/net/${NIC_NAME}/speed, unit: Mbps
TotalNetworkBandwidth resource.Quantity `json:"totalNetworkBandwidth,omitempty"`
}

// NodeSLOSpec defines the desired state of NodeSLO
Expand Down
63 changes: 63 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.

214 changes: 214 additions & 0 deletions config/crd/bases/slo.koordinator.sh_nodeslos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,47 @@ spec:
minimum: 1
type: integer
type: object
networkQOS:
properties:
egressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: EgressLimit describes the maximum percentage
of network bandwidth can be used in the egress direction,
bps(bytes per seconds), validate in 0%-100%
x-kubernetes-int-or-string: true
egressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: EgressRequest describes the minimum percentage
of network bandwidth guaranteed in the egress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
enable:
type: boolean
ingressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: IngressLimit describes the maximum percentage
of network bandwidth can be used in the ingress direction,
bps(bytes per seconds), valid in 0%-100%
x-kubernetes-int-or-string: true
ingressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: IngressRequest describes the minimum percentage
of network bandwidth guaranteed in the ingress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
type: object
resctrlQOS:
description: ResctrlQOSCfg stores node-level config of resctrl
qos
Expand Down Expand Up @@ -526,6 +567,47 @@ spec:
minimum: 1
type: integer
type: object
networkQOS:
properties:
egressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: EgressLimit describes the maximum percentage
of network bandwidth can be used in the egress direction,
bps(bytes per seconds), validate in 0%-100%
x-kubernetes-int-or-string: true
egressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: EgressRequest describes the minimum percentage
of network bandwidth guaranteed in the egress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
enable:
type: boolean
ingressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: IngressLimit describes the maximum percentage
of network bandwidth can be used in the ingress direction,
bps(bytes per seconds), valid in 0%-100%
x-kubernetes-int-or-string: true
ingressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: IngressRequest describes the minimum percentage
of network bandwidth guaranteed in the ingress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
type: object
resctrlQOS:
description: ResctrlQOSCfg stores node-level config of resctrl
qos
Expand Down Expand Up @@ -751,6 +833,47 @@ spec:
minimum: 1
type: integer
type: object
networkQOS:
properties:
egressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: EgressLimit describes the maximum percentage
of network bandwidth can be used in the egress direction,
bps(bytes per seconds), validate in 0%-100%
x-kubernetes-int-or-string: true
egressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: EgressRequest describes the minimum percentage
of network bandwidth guaranteed in the egress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
enable:
type: boolean
ingressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: IngressLimit describes the maximum percentage
of network bandwidth can be used in the ingress direction,
bps(bytes per seconds), valid in 0%-100%
x-kubernetes-int-or-string: true
ingressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: IngressRequest describes the minimum percentage
of network bandwidth guaranteed in the ingress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
type: object
resctrlQOS:
description: ResctrlQOSCfg stores node-level config of resctrl
qos
Expand Down Expand Up @@ -976,6 +1099,47 @@ spec:
minimum: 1
type: integer
type: object
networkQOS:
properties:
egressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: EgressLimit describes the maximum percentage
of network bandwidth can be used in the egress direction,
bps(bytes per seconds), validate in 0%-100%
x-kubernetes-int-or-string: true
egressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: EgressRequest describes the minimum percentage
of network bandwidth guaranteed in the egress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
enable:
type: boolean
ingressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: IngressLimit describes the maximum percentage
of network bandwidth can be used in the ingress direction,
bps(bytes per seconds), valid in 0%-100%
x-kubernetes-int-or-string: true
ingressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: IngressRequest describes the minimum percentage
of network bandwidth guaranteed in the ingress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
type: object
resctrlQOS:
description: ResctrlQOSCfg stores node-level config of resctrl
qos
Expand Down Expand Up @@ -1208,6 +1372,47 @@ spec:
minimum: 1
type: integer
type: object
networkQOS:
properties:
egressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: EgressLimit describes the maximum percentage
of network bandwidth can be used in the egress direction,
bps(bytes per seconds), validate in 0%-100%
x-kubernetes-int-or-string: true
egressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: EgressRequest describes the minimum percentage
of network bandwidth guaranteed in the egress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
enable:
type: boolean
ingressLimit:
anyOf:
- type: integer
- type: string
default: 100%
description: IngressLimit describes the maximum percentage
of network bandwidth can be used in the ingress direction,
bps(bytes per seconds), valid in 0%-100%
x-kubernetes-int-or-string: true
ingressRequest:
anyOf:
- type: integer
- type: string
default: 0%
description: IngressRequest describes the minimum percentage
of network bandwidth guaranteed in the ingress direction.
bps(bytes per second), valid in 0%-100%
x-kubernetes-int-or-string: true
type: object
resctrlQOS:
description: ResctrlQOSCfg stores node-level config of resctrl
qos
Expand Down Expand Up @@ -1308,6 +1513,15 @@ spec:
= minFreeKbytesFactor * nodeTotalMemory /10000
format: int64
type: integer
totalNetworkBandwidth:
anyOf:
- type: integer
- type: string
description: 'TotalNetworkBandwidth indicates the overall network
bandwidth, cluster manager can set this field, and default value
taken from /sys/class/net/${NIC_NAME}/speed, unit: Mbps'
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
watermarkScaleFactor:
description: /proc/sys/vm/watermark_scale_factor
format: int64
Expand Down
Loading

0 comments on commit 3a9db05

Please sign in to comment.