v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{
	Group:   "autoscaling.k8s.io",
	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 GoalMetric

type GoalMetric struct {
	Type      *MetricType `json:"type,omitempty"`
	AvgTarget float64     `json:"avgTarget,omitempty"`
}

GoalMetric describes a metric type with the goal for this metric.

func (*GoalMetric) DeepCopy

func (in *GoalMetric) DeepCopy() *GoalMetric

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

func (*GoalMetric) DeepCopyInto

func (in *GoalMetric) DeepCopyInto(out *GoalMetric)

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

type HorizontalScalingConstraints

type HorizontalScalingConstraints struct {
	// Lower limit for the number of pods that can be set by the autoscaler, default 1.
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// Upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than
	// MinReplicas.
	MaxReplicas *int32 `json:"maxReplicas"`
}

HorizontalScalingConstraints describes the constraints for horizontal scaling.

func (*HorizontalScalingConstraints) DeepCopy

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

func (*HorizontalScalingConstraints) DeepCopyInto

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

type MetricType

type MetricType string

MetricType controls which metric the goal is corresponding to. +kubebuilder:validation:Enum=Utilization;Latency;Throughput

const (
	// MetricTypeCPUUtilization means the goal is for CPU resource utilization.
	MetricTypeCPUUtilization MetricType = "CPUUtilization"
	// MetricTypeMemoryUtilization means the goal is for memory resource utilization.
	MetricTypeMemoryUtilization MetricType = "MemoryUtilization"
	// MetricTypeLatency means the goal is for latency.
	MetricTypeLatency MetricType = "Latency"
	// MetricTypeThroughput means the goal is for throughput.
	MetricTypeThroughput MetricType = "Throughput"
)

type MultidimPodAutoscaler

type MultidimPodAutoscaler struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Specification of the behavior of the autoscaler.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
	Spec MultidimPodAutoscalerSpec `json:"spec"`

	// Current information about the autoscaler.
	// +optional
	Status MultidimPodAutoscalerStatus `json:"status,omitempty"`
}

MultidimPodAutoscaler is the configuration for a multidimensional pod autoscaler, which automatically manages pod resources and number of replicas based on historical and real-time resource utilization as well as workload performance.

func (*MultidimPodAutoscaler) DeepCopy

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

func (*MultidimPodAutoscaler) DeepCopyInto

func (in *MultidimPodAutoscaler) DeepCopyInto(out *MultidimPodAutoscaler)

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

func (*MultidimPodAutoscaler) DeepCopyObject

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

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

type MultidimPodAutoscalerCondition

type MultidimPodAutoscalerCondition struct {
	// type describes the current condition
	Type MultidimPodAutoscalerConditionType `json:"type"`
	// status is the status of the condition (True, False, Unknown)
	Status v1.ConditionStatus `json:"status"`
	// lastTransitionTime is the last time the condition transitioned from one status to another
	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// reason is the reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`
	// message is a human-readable explanation containing details about the transition
	// +optional
	Message string `json:"message,omitempty"`
}

MultidimPodAutoscalerCondition describes the state of a MultidimPodAutoscaler at a certain point.

func (*MultidimPodAutoscalerCondition) DeepCopy

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

func (*MultidimPodAutoscalerCondition) DeepCopyInto

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

type MultidimPodAutoscalerConditionType

type MultidimPodAutoscalerConditionType string

MultidimPodAutoscalerConditionType are the valid conditions of a MultidimPodAutoscaler.

var (
	// RecommendationProvided indicates whether the MPA recommender was able to give a
	// recommendation.
	RecommendationProvided MultidimPodAutoscalerConditionType = "RecommendationProvided"
	// LowConfidence indicates whether the MPA recommender has low confidence in the recommendation
	// for some of containers.
	LowConfidence MultidimPodAutoscalerConditionType = "LowConfidence"
	// NoPodsMatched indicates that label selector used with MPA object didn't match any pods.
	NoPodsMatched MultidimPodAutoscalerConditionType = "NoPodsMatched"
	// FetchingHistory indicates that MPA recommender is in the process of loading additional
	// history samples.
	FetchingHistory MultidimPodAutoscalerConditionType = "FetchingHistory"
	// ConfigDeprecated indicates that this MPA configuration is deprecated and will stop being
	// supported soon.
	ConfigDeprecated MultidimPodAutoscalerConditionType = "ConfigDeprecated"
	// ConfigUnsupported indicates that this MPA configuration is unsupported and recommendations
	// will not be provided for it.
	ConfigUnsupported MultidimPodAutoscalerConditionType = "ConfigUnsupported"
)

type MultidimPodAutoscalerList

type MultidimPodAutoscalerList struct {
	metav1.TypeMeta `json:",inline"`
	// metadata is the standard list metadata.
	// +optional
	metav1.ListMeta `json:"metadata"`

	// items is the list of Multidimensional Pod Autoscaler objects.
	Items []MultidimPodAutoscaler `json:"items"`
}

MultidimPodAutoscalerList is a list of MultidimPodAutoscaler objects.

func (*MultidimPodAutoscalerList) DeepCopy

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

func (*MultidimPodAutoscalerList) DeepCopyInto

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

func (*MultidimPodAutoscalerList) DeepCopyObject

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

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

type MultidimPodAutoscalerRecommenderSelector

type MultidimPodAutoscalerRecommenderSelector struct {
	// Name of the recommender responsible for generating recommendation for this object.
	Name string `json:"name"`
}

MultidimPodAutoscalerRecommenderSelector points to a specific Multidimensional Pod Autoscaler recommender. In the future it might pass parameters to the recommender.

func (*MultidimPodAutoscalerRecommenderSelector) DeepCopy

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

func (*MultidimPodAutoscalerRecommenderSelector) DeepCopyInto

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

type MultidimPodAutoscalerSpec

type MultidimPodAutoscalerSpec struct {
	// ScaleTargetRef points to the controller managing the set of pods for the autoscaler to
	// control, e.g., Deployment, StatefulSet. MultidimPodAutoscaler can be targeted at controller
	// implementing scale subresource (the pod set is retrieved from the controller's ScaleStatus
	// or some well known controllers (e.g., for DaemonSet the pod set is read from the
	// controller's spec). If MultidimPodAutoscaler cannot use specified target it will report
	// the ConfigUnsupported condition.
	ScaleTargetRef *autoscaling.CrossVersionObjectReference `json:"scaleTargetRef"`

	// Describes the rules on how changes are applied to the pods.
	// If not specified, all fields in the `PodUpdatePolicy` are set to their default values.
	// +optional
	UpdatePolicy *PodUpdatePolicy `json:"updatePolicy,omitempty"`

	// Describes the goals in terms of both resource utilization and workload performance.
	Goals *ScalingGoals `json:"goals"`

	// Describes the constraints for the number of replicas.
	Constraints *HorizontalScalingConstraints `json:"constraints,omitempty"`
	// Controls how the VPA autoscaler computes recommended resources.
	// The resource policy is also used to set constraints on the recommendations for individual
	// containers. If not specified, the autoscaler computes recommended resources for all
	// containers in the pod, without additional constraints.
	// +optional
	ResourcePolicy *vpa.PodResourcePolicy `json:"resourcePolicy,omitempty"`

	// Recommender responsible for generating recommendation for the set of pods and the deployment.
	// List should be empty (then the default recommender will be used) or contain exactly one
	// recommender.
	// +optional
	Recommenders []*MultidimPodAutoscalerRecommenderSelector `json:"recommenders,omitempty"`
}

MultidimPodAutoscalerSpec is the specification of the behavior of the autoscaler.

func (*MultidimPodAutoscalerSpec) DeepCopy

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

func (*MultidimPodAutoscalerSpec) DeepCopyInto

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

type MultidimPodAutoscalerStatus

type MultidimPodAutoscalerStatus struct {
	// Last time the MultidimPodAutoscaler scaled the number of pods and resizes containers;
	// Used by the autoscaler to control how often scaling operations are performed.
	// +optional
	LastScaleTime *metav1.Time `json:"lastScaleTime,omitempty"`

	// Current number of replicas of pods managed by this autoscaler.
	CurrentReplicas int32 `json:"currentReplicas"`

	// Desired number of replicas of pods managed by this autoscaler.
	DesiredReplicas int32 `json:"desiredReplicas"`

	// The most recently computed amount of resources for each controlled pod recommended by the
	// autoscaler.
	// +optional
	Recommendation *vpa.RecommendedPodResources `json:"recommendation,omitempty"`

	// Current average CPU utilization over all pods, represented as a ratio with the requested CPU.
	// E.g., 0.7 means that an average pod is using now 70% of its requested CPU.
	// +optional
	CurrentCPUUtilization float64 `json:"currentCPUUtilization,omitempty"`

	// Current average memory utilization over all pods, represented as a ratio with the requested
	// memory.
	// +optional
	CurrentMemoryUtilization float64 `json:"currentMemoryUtilization,omitempty"`

	// Current average latency preservation over all pods, represented as a ratio with the target
	// latency.
	// +optional
	CurrentLatencyPreservation float64 `json:"currentLatencyPreservation,omitempty"`

	// Current average throughput preservation over all pods, represented as a ratio with the
	// target throughput.
	// +optional
	CurrentThroughputPreservation float64 `json:"currentThroughputPreservation,omitempty"`

	// Conditions is the set of conditions required for this autoscaler to scale its target, and
	// indicates whether or not those conditions are met.
	// +optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []MultidimPodAutoscalerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

Describes the current status of a multidimensional pod autoscaler

func (*MultidimPodAutoscalerStatus) DeepCopy

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

func (*MultidimPodAutoscalerStatus) DeepCopyInto

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

type PodUpdatePolicy

type PodUpdatePolicy struct {
	// Controls when autoscaler applies changes to the pod resources.
	// The default is 'Auto'.
	// +optional
	UpdateMode *vpa.UpdateMode `json:"updateMode,omitempty"`
}

PodUpdatePolicy describes the rules on how changes are applied to the pods.

func (*PodUpdatePolicy) DeepCopy

func (in *PodUpdatePolicy) DeepCopy() *PodUpdatePolicy

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

func (*PodUpdatePolicy) DeepCopyInto

func (in *PodUpdatePolicy) DeepCopyInto(out *PodUpdatePolicy)

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

type ScalingGoals

type ScalingGoals struct {
	GoalMetrics []*GoalMetric `json:"goalMetrics,omitempty"`
}

ScalingGoals describes the resource utilization and performance goals.

func (*ScalingGoals) DeepCopy

func (in *ScalingGoals) DeepCopy() *ScalingGoals

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

func (*ScalingGoals) DeepCopyInto

func (in *ScalingGoals) DeepCopyInto(out *ScalingGoals)

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