v1alpha1

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the crane API. +k8s:deepcopy-gen=package,register +groupName=prediction.crane.io

Index

Constants

View Source
const (
	// PredictionModeInstant means predicting a single point in the future, for example the maximum value for the next hour
	PredictionModeInstant = "instant"
	// PredictionModeRange means predicting a time series during a range of time in the future.
	PredictionModeRange = "range"
)
View Source
const GroupName = "prediction.crane.io"

GroupName specifies the group name used to register the objects.

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Depreciated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AlgorithmType

type AlgorithmType string
const (
	AlgorithmTypePercentile AlgorithmType = "percentile"
	AlgorithmTypeDSP        AlgorithmType = "dsp"
)

type Dsp

type Dsp struct {
	// SampleInterval is the sampling interval of metrics.
	SampleInterval string `json:"sampleInterval,omitempty"`
	// HistoryLength describes how long back should be queried against provider to get historical metrics for prediction.
	HistoryLength string `json:"historyLength,omitempty"`
	// Estimator
	Estimator Estimator `json:"estimators,omitempty"`
}

func (*Dsp) DeepCopy

func (in *Dsp) DeepCopy() *Dsp

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

func (*Dsp) DeepCopyInto

func (in *Dsp) DeepCopyInto(out *Dsp)

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

type Estimator

type Estimator struct {
	// +optional
	MaxValueEstimators []*MaxValueEstimator `json:"maxValue,omitempty"`
	// +optional
	FFTEstimators []*FFTEstimator `json:"fft,omitempty"`
}

func (*Estimator) DeepCopy

func (in *Estimator) DeepCopy() *Estimator

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

func (*Estimator) DeepCopyInto

func (in *Estimator) DeepCopyInto(out *Estimator)

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

type FFTEstimator

type FFTEstimator struct {
	MarginFraction         string `json:"marginFraction,omitempty"`
	LowAmplitudeThreshold  string `json:"lowAmplitudeThreshold,omitempty"`
	HighFrequencyThreshold string `json:"highFrequencyThreshold,omitempty"`
	MinNumOfSpectrumItems  int32  `json:"minNumOfSpectrumItems,omitempty"`
	MaxNumOfSpectrumItems  int32  `json:"maxNumOfSpectrumItems,omitempty"`
}

func (*FFTEstimator) DeepCopy

func (in *FFTEstimator) DeepCopy() *FFTEstimator

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

func (*FFTEstimator) DeepCopyInto

func (in *FFTEstimator) DeepCopyInto(out *FFTEstimator)

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

type HistogramConfig

type HistogramConfig struct {
	MaxValue              string `json:"maxValue,omitempty"`
	Epsilon               string `json:"epsilon,omitempty"`
	HalfLife              string `json:"halfLife,omitempty"`
	BucketSize            string `json:"bucketSize,omitempty"`
	FirstBucketSize       string `json:"firstBucketSize,omitempty"`
	BucketSizeGrowthRatio string `json:"bucketSizeGrowthRatio,omitempty"`
}

func (*HistogramConfig) DeepCopy

func (in *HistogramConfig) DeepCopy() *HistogramConfig

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

func (*HistogramConfig) DeepCopyInto

func (in *HistogramConfig) DeepCopyInto(out *HistogramConfig)

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

type MaxValueEstimator

type MaxValueEstimator struct{}

func (*MaxValueEstimator) DeepCopy

func (in *MaxValueEstimator) DeepCopy() *MaxValueEstimator

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

func (*MaxValueEstimator) DeepCopyInto

func (in *MaxValueEstimator) DeepCopyInto(out *MaxValueEstimator)

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

type MetricPredictionConfig

type MetricPredictionConfig struct {
	MetricName    string        `json:"metricName,omitempty"`
	AlgorithmType AlgorithmType `json:"algorithmType,omitempty"`
	// +optional
	DSP *Dsp `json:"dsp,omitempty"`
	// +optional
	Percentile *Percentile `json:"percentile,omitempty"`
}

func (*MetricPredictionConfig) DeepCopy

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

func (*MetricPredictionConfig) DeepCopyInto

func (in *MetricPredictionConfig) DeepCopyInto(out *MetricPredictionConfig)

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

type NodePrediction

type NodePrediction struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec NodePredictionResourceSpec `json:"spec"`

	// +optional
	Status NodePredictionResourceStatus `json:"status"`
}

NodePrediction is the node prediction resource, which is associated with a node.

func (*NodePrediction) DeepCopy

func (in *NodePrediction) DeepCopy() *NodePrediction

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

func (*NodePrediction) DeepCopyInto

func (in *NodePrediction) DeepCopyInto(out *NodePrediction)

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

func (*NodePrediction) DeepCopyObject

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

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

type NodePredictionList

type NodePredictionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []NodePrediction `json:"items"`
}

NodePredictionList is a list of NodePrediction resources

func (*NodePredictionList) DeepCopy

func (in *NodePredictionList) DeepCopy() *NodePredictionList

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

func (*NodePredictionList) DeepCopyInto

func (in *NodePredictionList) DeepCopyInto(out *NodePredictionList)

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

func (*NodePredictionList) DeepCopyObject

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

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

type NodePredictionResourceSpec

type NodePredictionResourceSpec struct {
	// Period is the prediction time series interval or step.
	Period metav1.Duration `json:"period,omitempty"`
	// Mode is the prediction time series mode
	Mode PredictionMode `json:"mode,omitempty"`
	// MetricPredictionConfigs is the prediction configs of metric. each metric has its config for different prediction behaviors
	MetricPredictionConfigs []MetricPredictionConfig `json:"metricPredictionConfigs,omitempty"`
}

NodePredictionResourceSpec is the specification of a node prediction.

func (*NodePredictionResourceSpec) DeepCopy

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

func (*NodePredictionResourceSpec) DeepCopyInto

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

type NodePredictionResourceStatus

type NodePredictionResourceStatus struct {
	// NextPossible is the predicted resource usage in next resolution point based on previous series.
	NextPossible Prediction `json:"nextPossible,omitempty"`
}

NodePredictionResourceStatus represents information about the status of NodePrediction

func (*NodePredictionResourceStatus) DeepCopy

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

func (*NodePredictionResourceStatus) DeepCopyInto

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

type Percentile

type Percentile struct {
	SampleInterval  string          `json:"sampleInterval,omitempty"`
	Histogram       HistogramConfig `json:"histogram,omitempty"`
	MinSampleWeight string          `json:"minSampleWeight,omitempty"`
}

func (*Percentile) DeepCopy

func (in *Percentile) DeepCopy() *Percentile

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

func (*Percentile) DeepCopyInto

func (in *Percentile) DeepCopyInto(out *Percentile)

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

type PodGroupPrediction

type PodGroupPrediction struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec PodGroupPredictionSpec `json:"spec,omitempty"`

	// +optional
	Status PodGroupPredictionStatus `json:"status,omitempty"`
}

PodGroupPrediction is a prediction on the resource consumed by a pod group. In kubernetes context, a pod group often refers to a batch of pods that satisfy a label selector.

func (*PodGroupPrediction) DeepCopy

func (in *PodGroupPrediction) DeepCopy() *PodGroupPrediction

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

func (*PodGroupPrediction) DeepCopyInto

func (in *PodGroupPrediction) DeepCopyInto(out *PodGroupPrediction)

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

func (*PodGroupPrediction) DeepCopyObject

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

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

type PodGroupPredictionCondition

type PodGroupPredictionCondition struct {
	// Type is the type of the condition.
	Type PodGroupPredictionConditionType `json:"type,omitempty"`
	// Status is the status of the condition.
	// Can be True, False, Unknown.
	Status metav1.ConditionStatus `json:"status,omitempty"`
	// Last time we probed the condition.
	// +optional
	LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
	// Last time the condition transitioned from one status to another.
	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// Unique, one-word, CamelCase reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`
	// Human-readable message indicating details about last transition.
	// +optional
	Message string `json:"message,omitempty"`
}

PodGroupPredictionCondition contains details for the current condition of this pod.

func (*PodGroupPredictionCondition) DeepCopy

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

func (*PodGroupPredictionCondition) DeepCopyInto

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

type PodGroupPredictionConditionType

type PodGroupPredictionConditionType string

PodGroupPredictionConditionType is a valid value for PodGroupPredictionCondition.Type

const (
	// PredictionConditionCharging means no valid prediction series is available, just wait to predict.
	PredictionConditionCharging PodGroupPredictionConditionType = "Charging"
	// PredictionConditionPredicting means the prediction routine is ongoing and the prediction data is valid.
	PredictionConditionPredicting PodGroupPredictionConditionType = "Predicting"
	// PredictionConditionNotStarted means the prediction routine has not started yet.
	PredictionConditionNotStarted PodGroupPredictionConditionType = "NotStarted"
	// PredictionStatusFinished means the prediction has finished, the prediction data will not be updated anymore.
	PredictionConditionFinished PodGroupPredictionConditionType = "Finished"
)

These are valid conditions of PodGroupPrediction.

type PodGroupPredictionList

type PodGroupPredictionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []PodGroupPrediction `json:"items"`
}

PodGroupPredictionList is a list of PodGroupPrediction

func (*PodGroupPredictionList) DeepCopy

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

func (*PodGroupPredictionList) DeepCopyInto

func (in *PodGroupPredictionList) DeepCopyInto(out *PodGroupPredictionList)

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

func (*PodGroupPredictionList) DeepCopyObject

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

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

type PodGroupPredictionSpec

type PodGroupPredictionSpec struct {
	// Prediction start time. If not specified, the prediction starts from the object creationTimestamp.
	// +optional
	Start *metav1.Time `json:"start,omitempty"`
	// Prediction end time. If current time is after end, the prediction will be stopped and the status will not be updated afterward.
	// If end is null, the prediction will never stop.
	// +optional
	End *metav1.Time `json:"end,omitempty"`
	// PredictionWindow, for example, 24-hours means predicting time series in next 24 hours.
	// This should be used only for PredictionModeRange.
	PredictionWindow metav1.Duration `json:"predictionWindow,omitempty"`
	// Mode is the prediction time series mode. instant or range
	Mode PredictionMode `json:"mode,omitempty"`
	// Pods is a list of pod names that belong to this pod group.
	// If not specified then WorkloadRef is invalid.
	// The aggregator aggregate priority is  Pods > WorkloadRef > LabelSelector
	// +optional
	Pods []string `json:"pods,omitempty"`
	// WorkloadRef is a ref of workload(deployment/statefulsets).
	// +optional
	WorkloadRef *autoscalingv2.CrossVersionObjectReference `json:"workloadRef,omitempty"`
	// LabelSelector is the aggregator label selector. aggregator group all data by same key . for example, [online: label=v1] denotes all pods with label label=v1 will aggregate by sum all the resources.
	// +optional
	LabelSelector metav1.LabelSelector `json:"labelSelector,omitempty"`
	// MetricPredictionConfigs is the prediction configs of metric. each metric has its config for different prediction behaviors
	MetricPredictionConfigs []MetricPredictionConfig `json:"metricPredictionConfigs,omitempty"`
}

PodGroupPredictionSpec is a description of a PodGroupPrediction.

func (*PodGroupPredictionSpec) DeepCopy

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

func (*PodGroupPredictionSpec) DeepCopyInto

func (in *PodGroupPredictionSpec) DeepCopyInto(out *PodGroupPredictionSpec)

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

type PodGroupPredictionStatus

type PodGroupPredictionStatus struct {
	// Conditions is the condition of PodGroupPrediction
	Conditions []PodGroupPredictionCondition `json:"conditions,omitempty"`
	// Status
	Status PredictionStatus `json:"status,omitempty"`
	// Aggregation is the aggregated prediction value of all pods.
	Aggregation Prediction `json:"aggregation,omitempty"`
	// Containers is all the containers in pod group. excludes pause container. key is the namesapce/podname/containername
	Containers map[string]Prediction `json:"containers,omitempty"`
}

PodGroupPredictionStatus

func (*PodGroupPredictionStatus) DeepCopy

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

func (*PodGroupPredictionStatus) DeepCopyInto

func (in *PodGroupPredictionStatus) DeepCopyInto(out *PodGroupPredictionStatus)

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

type Prediction

type Prediction map[string]TimeSeries

Prediction define metrics prediction

func (Prediction) DeepCopy

func (in Prediction) DeepCopy() Prediction

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

func (Prediction) DeepCopyInto

func (in Prediction) DeepCopyInto(out *Prediction)

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

type PredictionMode

type PredictionMode string

PredictionMode represents the prediction time series mode.

type PredictionStatus

type PredictionStatus string
const (
	// PredictionStatusPending - no valid prediction series available, wait for prediction.
	PredictionStatusPending PredictionStatus = "Pending"
	// PredictionStatusPredicting - prediction is on the way, result is ready and value is valid.
	PredictionStatusPredicting PredictionStatus = "Predicting"
	// PredictionStatusNotStarted - the prediction has not start.
	PredictionStatusNotStarted PredictionStatus = "NotStarted"
	// PredictionStatusCompleted - the prediction has competed.
	PredictionStatusCompleted PredictionStatus = "Completed"
)

type ResourceName

type ResourceName string

ResourceName represents the name of the resource.

const (
	// ResourceCPU represents CPU in milli cores (1 core = 1000 milli cores).
	ResourceCPU ResourceName = "cpu"
	// ResourceMemory represents memory in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024).
	ResourceMemory ResourceName = "memory"
)

type TimeSeries

type TimeSeries []*Vector

TimeSeries

func (TimeSeries) DeepCopy

func (in TimeSeries) DeepCopy() TimeSeries

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

func (TimeSeries) DeepCopyInto

func (in TimeSeries) DeepCopyInto(out *TimeSeries)

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

type Vector

type Vector struct {
	// CRD not support float64
	Value     string `json:"value,omitempty"`
	Timestamp int64  `json:"timestamp,omitempty"`
}

Vector

func (*Vector) DeepCopy

func (in *Vector) DeepCopy() *Vector

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

func (*Vector) DeepCopyInto

func (in *Vector) DeepCopyInto(out *Vector)

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