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
  • Loading branch information
lucming committed Dec 24, 2023
1 parent b24cec7 commit 5dc3dbe
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 191 deletions.
25 changes: 10 additions & 15 deletions apis/slo/v1alpha1/nodeslo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ 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 @@ -207,37 +208,28 @@ type ResourceQOS struct {
}

type NetworkQOSCfg struct {
Enable *bool `json:"enable,omitempty"`
NetworkQOS `json:",inline"`
TotalNetworkBandwidth resource.Quantity `json:"totalNetworkBandwidth,omitempty"`
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
// +kubebuilder:validation:Maximum=100
// +kubebuilder:validation:Minimum=0
IngressRequest *int64 `json:"ingressRequest,omitempty" validate:"omitempty,min=0,max=100"`
IngressRequest *intstr.IntOrString `json:"ingressRequest,omitempty" validate:"omitempty,min=0,max=100"`
// 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
// +kubebuilder:validation:Maximum=100
// +kubebuilder:validation:Minimum=0
IngressLimit *int64 `json:"ingressLimit,omitempty" validate:"omitempty,min=0,max=100"`
IngressLimit *intstr.IntOrString `json:"ingressLimit,omitempty" validate:"omitempty,min=0,max=100"`

// EgressRequest describes the minimum percentage of network bandwidth guaranteed in the egress direction.
// bps(bytes per second), valid in 0-100
// +kubebuilder:default=0
// +kubebuilder:validation:Maximum=100
// +kubebuilder:validation:Minimum=0
EgressRequest *int64 `json:"egressRequest,omitempty" validate:"omitempty,min=0,max=100"`
EgressRequest *intstr.IntOrString `json:"egressRequest,omitempty" validate:"omitempty,min=0,max=100"`
// 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
// +kubebuilder:validation:Maximum=100
// +kubebuilder:validation:Minimum=0
EgressLimit *int64 `json:"egressLimit,omitempty" validate:"omitempty,min=0,max=100"`
EgressLimit *intstr.IntOrString `json:"egressLimit,omitempty" validate:"omitempty,min=0,max=100"`
}

type ResourceQOSPolicies struct {
Expand Down Expand Up @@ -376,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
50 changes: 45 additions & 5 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

0 comments on commit 5dc3dbe

Please sign in to comment.