v1alpha1

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 18

Documentation

Overview

Package v1alpha1 provides alpha API for Katalyst Workload API objects.

Index

Constants

View Source
const (
	// IndicatorLevelLowerBound is usually used to define the lower bound to define
	// service working states. For instance, if rpc-latency is defined as a
	// business indicator, if actual observed value is below IndicatorLevelLowerBound,
	//	it means the workload works perfectly; if observed value is above
	// 	IndicatorLevelLowerBound but below IndicatorLevelUpperBound, it means the workload
	//	works can still work, but may suffer with performance downgrade.
	IndicatorLevelLowerBound = "LowerBound"

	// IndicatorLevelUpperBound is usually used to define the upper bound that
	// the workload be bear with. For instance, if rpc-latency is defined as a
	// business indicator, if actual observed value is above IndicatorLevelUpperBound,
	// it means the workload is broken and can't serve the online traffic anymore.
	IndicatorLevelUpperBound = "UpperBound"
)
View Source
const (
	ExtendedIndicatorSuffix = "Indicators"
)
View Source
const (
	// GroupName is the group name used in this package
	GroupName string = "workload.katalyst.kubewharf.io"
)
View Source
const (
	ResourceNameServiceProfileDescriptors = "serviceprofiledescriptors"
)

ResourceNameServiceProfileDescriptors const is used to construct standard gvr

Variables

View Source
var (
	// SchemeBuilder collects schemas to build.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is used by generated client to add this scheme to the generated client.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AggPodMetrics

type AggPodMetrics struct {
	// Aggregator indicates how the metrics data in Items are calculated, i.e.
	// defines the aggregation functions.
	Aggregator Aggregator `json:"aggregator"`

	// +optional
	Scope string `json:"scope,omitempty"`

	// +optional
	Items []metrics.PodMetrics `json:"items,omitempty"`
}

AggPodMetrics records the aggregated metrics based.

func (*AggPodMetrics) DeepCopy

func (in *AggPodMetrics) DeepCopy() *AggPodMetrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggPodMetrics.

func (*AggPodMetrics) DeepCopyInto

func (in *AggPodMetrics) DeepCopyInto(out *AggPodMetrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Aggregator

type Aggregator string
const (
	Avg Aggregator = "avg"
	Max Aggregator = "max"
	Sum Aggregator = "sum"
)

type Indicator added in v0.0.2

type Indicator struct {
	IndicatorLevel IndicatorLevelName `json:"indicatorLevel"`
	Value          float32            `json:"value"`
}

func (*Indicator) DeepCopy added in v0.0.2

func (in *Indicator) DeepCopy() *Indicator

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Indicator.

func (*Indicator) DeepCopyInto added in v0.0.2

func (in *Indicator) DeepCopyInto(out *Indicator)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IndicatorLevelName added in v0.0.2

type IndicatorLevelName string

IndicatorLevelName defines several levels for each indicator, and we will always try to keep the actual indicator in acceptable intervals instead of as an accurate value. Those intervals are marked by IndicatorLevelName.

type ServiceBusinessIndicatorName added in v0.0.2

type ServiceBusinessIndicatorName string
const (
	ServiceBusinessIndicatorNameRPCLatency ServiceBusinessIndicatorName = "RPCLatency"
)

type ServiceBusinessIndicatorSpec added in v0.0.2

type ServiceBusinessIndicatorSpec struct {
	// Name is used to define the business-related profiling indicator for the workload,
	// e.g. rpc-latency, success-rate, service-health-score and so on.
	// Users can use it as an expended way, and customize sysadvisor to adapter with it.
	Name ServiceBusinessIndicatorName `json:"name"`

	// +optional
	Indicators []Indicator `json:"indicators,omitempty"`
}

ServiceBusinessIndicatorSpec defines workload profiling in business level, such as rpc-latency, success-rate, service-health-score and so on, and general control-flow works as below

- according to workload states, user defines several key indicates - user-system calculate and update observed values in status - sysadvisor (in-tree katalyst) decides system-indicator offset according to business-indicator - sysadvisor (along with reporter and qrm) to perform resources and controlKnob actions

func (*ServiceBusinessIndicatorSpec) DeepCopy added in v0.0.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBusinessIndicatorSpec.

func (*ServiceBusinessIndicatorSpec) DeepCopyInto added in v0.0.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceBusinessIndicatorStatus added in v0.0.2

type ServiceBusinessIndicatorStatus struct {
	Name ServiceBusinessIndicatorName `json:"name"`

	// Current indicates the current observed value for this business indicator
	// +optional
	Current *float32 `json:"current,omitempty"`
}

ServiceBusinessIndicatorStatus is connected with ServiceBusinessIndicatorSpec with Name to indicate the observed info for this workload (as for this indicator).

func (*ServiceBusinessIndicatorStatus) DeepCopy added in v0.0.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBusinessIndicatorStatus.

func (*ServiceBusinessIndicatorStatus) DeepCopyInto added in v0.0.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceExtendedIndicatorSpec added in v0.5.0

type ServiceExtendedIndicatorSpec struct {
	// Name defines the name of extended module
	Name string `json:"name"`

	// BaselinePercent marks off a bunch of instances, and skip applying extended indicator
	// for them; those instances are defined as baselines, and can be compared
	// with other (experimental/production) instances to demonstrate the benefits.
	// If BaselinePercent is not set, we should take all instances as production instances.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// +optional
	BaselinePercent *int32 `json:"baselinePercent,omitempty"`

	// Indicators defines extend workload characteristics, Indicators can have arbitrary structure.
	// Each kind of Indicator must be named using Name, followed by the suffix 'Indicators'.
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	Indicators runtime.RawExtension `json:"indicators,omitempty"`
}

ServiceExtendedIndicatorSpec specifies extended workload characteristics and can serve as an extension to indicators beyond business and system scopes. Examples include policies for custom memory reclamation and I/O limitations specific to a service.

func (*ServiceExtendedIndicatorSpec) DeepCopy added in v0.5.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExtendedIndicatorSpec.

func (*ServiceExtendedIndicatorSpec) DeepCopyInto added in v0.5.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceProfileDescriptor

type ServiceProfileDescriptor struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the behavior of a ServiceProfileDescriptor.
	// +optional
	Spec ServiceProfileDescriptorSpec `json:"spec,omitempty"`

	// Status represents the concrete samples of ServiceProfileData with multiple resources.
	// +optional
	Status ServiceProfileDescriptorStatus `json:"status,omitempty"`
}

ServiceProfileDescriptor captures information about a service workload

func (*ServiceProfileDescriptor) DecodeNestedObjects added in v0.5.0

func (c *ServiceProfileDescriptor) DecodeNestedObjects(d runtime.Decoder) error

DecodeNestedObjects decodes extended indicator for known types.

func (*ServiceProfileDescriptor) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceProfileDescriptor.

func (*ServiceProfileDescriptor) DeepCopyInto

func (in *ServiceProfileDescriptor) DeepCopyInto(out *ServiceProfileDescriptor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceProfileDescriptor) DeepCopyObject

func (in *ServiceProfileDescriptor) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ServiceProfileDescriptor) EncodeNestedObjects added in v0.5.0

func (c *ServiceProfileDescriptor) EncodeNestedObjects(e runtime.Encoder) error

EncodeNestedObjects encodes extended indicator.

type ServiceProfileDescriptorList

type ServiceProfileDescriptorList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard list metadata
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// items is the list of SPDs
	Items []ServiceProfileDescriptor `json:"items"`
}

ServiceProfileDescriptorList is a collection of SPD objects.

func (*ServiceProfileDescriptorList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceProfileDescriptorList.

func (*ServiceProfileDescriptorList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceProfileDescriptorList) DeepCopyObject

func (in *ServiceProfileDescriptorList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ServiceProfileDescriptorSpec

type ServiceProfileDescriptorSpec struct {
	// TargetRef points to the controller managing the set of pods for the
	// spd-controller to control - e.g. Deployment, StatefulSet.
	// SPD should have one-to-one mapping relationships with workload.
	TargetRef v1alpha1.CrossVersionObjectReference `json:"targetRef"`

	// BaselinePercent marks off a bunch of instances, and skip adjusting Knobs
	// for them; those instances are defined as baselines, and can be compared
	// with other (experimental/production) instances to demonstrate the benefits.
	// If BaselinePercent is not set, we should take all instances as production instances.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// +optional
	BaselinePercent *int32 `json:"baselinePercent,omitempty"`

	// if multiple ExtendedIndicator are defined, it means that the service should
	// satisfy all the strategies in those extended indicators
	// +optional
	// +listMapKey=name
	// +listType=map
	ExtendedIndicator []ServiceExtendedIndicatorSpec `json:"extendedIndicator,omitempty"`

	// if multiple BusinessIndicator are defined, it means that we should
	// try to satisfy all of those indicator targets
	// +optional
	// +listMapKey=name
	// +listType=map
	BusinessIndicator []ServiceBusinessIndicatorSpec `json:"businessIndicator,omitempty"`

	// if multiple SystemIndicator are defined, it means that we should
	// try to satisfy all of those indicator targets
	// +optional
	// +listMapKey=name
	// +listType=map
	SystemIndicator []ServiceSystemIndicatorSpec `json:"systemIndicator,omitempty"`
}

ServiceProfileDescriptorSpec is the specification of the behavior of the SPD.

func (*ServiceProfileDescriptorSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceProfileDescriptorSpec.

func (*ServiceProfileDescriptorSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceProfileDescriptorStatus

type ServiceProfileDescriptorStatus struct {
	// +optional
	AggMetrics []AggPodMetrics `json:"aggMetrics,omitempty"`

	// +optional
	BusinessStatus []ServiceBusinessIndicatorStatus `json:"businessStatus,omitempty"`
}

ServiceProfileDescriptorStatus describes the observed info of the spd.

func (*ServiceProfileDescriptorStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceProfileDescriptorStatus.

func (*ServiceProfileDescriptorStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceSystemIndicatorName added in v0.5.0

type ServiceSystemIndicatorName string
const (
	ServiceSystemIndicatorNameCPUSchedWait             ServiceSystemIndicatorName = "cpu_sched_wait"
	ServiceSystemIndicatorNameCPUUsageRatio            ServiceSystemIndicatorName = "cpu_usage_ratio"
	ServiceSystemIndicatorNameCPI                      ServiceSystemIndicatorName = "cpi"
	ServiceSystemIndicatorNameMemoryAccessWriteLatency ServiceSystemIndicatorName = "mem_access_write_lat"
	ServiceSystemIndicatorNameMemoryAccessReadLatency  ServiceSystemIndicatorName = "mem_access_read_lat"
	ServiceSystemIndicatorNameMemoryL3MissLatency      ServiceSystemIndicatorName = "mem_l3_miss_lat"
)

type ServiceSystemIndicatorSpec added in v0.0.2

type ServiceSystemIndicatorSpec struct {
	// Name is used to define the system-related profiling indicator for the workload,
	// e.g. cpu_sched_wait、cpi、mbw ... and so on.
	// Users can use it as an expended way, and customize sysadvisor to adapter with it.
	Name ServiceSystemIndicatorName `json:"name"`

	// +optional
	Indicators []Indicator `json:"indicators,omitempty"`
}

ServiceSystemIndicatorSpec defines workload profiling in system level, such as cpu_sched_wait、cpi、mbw ... and so on, and sysadvisor (along with reporter and qrm) will try to perform resources and controlKnob actions

System-target indicator (along with its values in each level) could be difficult to pre-define, and it may have strong correlations with both workload characters and node environments, so we suggest users to run offline analysis pipelines to get those stats.

func (*ServiceSystemIndicatorSpec) DeepCopy added in v0.0.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSystemIndicatorSpec.

func (*ServiceSystemIndicatorSpec) DeepCopyInto added in v0.0.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestExtendedIndicators added in v0.5.0

type TestExtendedIndicators struct {
	metav1.TypeMeta `json:",inline"`

	Indicators *TestIndicators `json:"indicators"`
}

TestExtendedIndicators just for extended indicator test

func (*TestExtendedIndicators) DeepCopy added in v0.5.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestExtendedIndicators.

func (*TestExtendedIndicators) DeepCopyInto added in v0.5.0

func (in *TestExtendedIndicators) DeepCopyInto(out *TestExtendedIndicators)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TestExtendedIndicators) DeepCopyObject added in v0.5.0

func (in *TestExtendedIndicators) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TestIndicators added in v0.5.0

type TestIndicators struct {
	TestIndicator string `json:"testIndicator"`
}

func (*TestIndicators) DeepCopy added in v0.5.0

func (in *TestIndicators) DeepCopy() *TestIndicators

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestIndicators.

func (*TestIndicators) DeepCopyInto added in v0.5.0

func (in *TestIndicators) DeepCopyInto(out *TestIndicators)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL