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

docs: support NetworkQoS based on external plugin such as terway-qos #1779

Merged
merged 1 commit into from
Jan 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
39 changes: 39 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,40 @@ 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 network bandwidth guaranteed in the ingress direction.
// unit: bps(bytes per second), two expressions are supported,int and string,
// int: percentage based on total bandwidth,valid in 0-100
// string: a specific network bandwidth value, eg: 50M.
// +kubebuilder:default=0
IngressRequest *intstr.IntOrString `json:"ingressRequest,omitempty"`
// IngressLimit describes the maximum network bandwidth can be used in the ingress direction,
// unit: bps(bytes per second), two expressions are supported,int and string,
// int: percentage based on total bandwidth,valid in 0-100
// string: a specific network bandwidth value, eg: 50M.
// +kubebuilder:default=100
IngressLimit *intstr.IntOrString `json:"ingressLimit,omitempty"`

// EgressRequest describes the minimum network bandwidth guaranteed in the egress direction.
// unit: bps(bytes per second), two expressions are supported,int and string,
// int: percentage based on total bandwidth,valid in 0-100
// string: a specific network bandwidth value, eg: 50M.
// +kubebuilder:default=0
EgressRequest *intstr.IntOrString `json:"egressRequest,omitempty"`
// EgressLimit describes the maximum network bandwidth can be used in the egress direction,
// unit: bps(bytes per second), two expressions are supported,int and string,
// int: percentage based on total bandwidth,valid in 0-100
// string: a specific network bandwidth value, eg: 50M.
// +kubebuilder:default=100
EgressLimit *intstr.IntOrString `json:"egressLimit,omitempty"`
}

type ResourceQOSPolicies struct {
Expand Down Expand Up @@ -340,6 +376,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.

Loading