Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the scaling v1alpha1 API group +kubebuilder:object:generate=true +groupName=scaling.core.adobe.com
Index ¶
- Variables
- type Algorithm
- type ExternalMetricSource
- type Kratos
- type KratosList
- type KratosSpec
- type KratosStatus
- type MetricIdentifier
- type MetricTarget
- type MetricTargetType
- type MetricType
- type ObjectMetricSource
- type PodsMetricSource
- type PrometheusMetricSource
- type Recommendation
- type ResourceMetricSource
- type ScaleBehavior
- type ScaleChangeEvent
- type ScaleMetric
- type ScaleRules
- type ScaleTargetReference
- type ScalingPolicy
- type ScalingPolicySelect
- type ScalingPolicyType
Constants ¶
This section is empty.
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "scaling.core.adobe.com", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm struct { Type string `json:"type" protobuf:"bytes,1,opt,name=type"` Options map[string]string `json:"options,omitempty" protobuf:"bytes,1,opt,name=options"` }
Algorithm to use for scale
func (*Algorithm) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Algorithm.
func (*Algorithm) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExternalMetricSource ¶
type ExternalMetricSource struct { // metric identifies the target metric by name and selector Metric MetricIdentifier `json:"metric" protobuf:"bytes,1,name=metric"` // target specifies the target value for the given metric Target MetricTarget `json:"target" protobuf:"bytes,2,name=target"` }
ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).
func (*ExternalMetricSource) DeepCopy ¶
func (in *ExternalMetricSource) DeepCopy() *ExternalMetricSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalMetricSource.
func (*ExternalMetricSource) DeepCopyInto ¶
func (in *ExternalMetricSource) DeepCopyInto(out *ExternalMetricSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Kratos ¶
type Kratos struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec KratosSpec `json:"spec,omitempty"` Status KratosStatus `json:"status,omitempty"` }
Kratos is the Schema for the kratos API
func (*Kratos) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kratos.
func (*Kratos) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Kratos) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type KratosList ¶
type KratosList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Kratos `json:"items"` }
KratosList contains a list of Kratos
func (*KratosList) DeepCopy ¶
func (in *KratosList) DeepCopy() *KratosList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KratosList.
func (*KratosList) DeepCopyInto ¶
func (in *KratosList) DeepCopyInto(out *KratosList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*KratosList) DeepCopyObject ¶
func (in *KratosList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type KratosSpec ¶
type KratosSpec struct { Target ScaleTargetReference `json:"target" protobuf:"bytes,1,opt,name=target"` Algorithm Algorithm `json:"algorithm" protobuf:"bytes,2,opt,name=algorithm"` // minReplicas is the lower limit for the number of replicas to which the autoscaler // can scale down. It defaults to 1 pod. MinReplicas int32 `json:"minReplicas,omitempty" protobuf:"varint,3,opt,name=minReplicas"` // upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas. MaxReplicas int32 `json:"maxReplicas" protobuf:"varint,4,opt,name=maxReplicas"` // stabilization window in seconds StabilizationWindowSeconds int32 `json:"stabilizationWindowSeconds" protobuf:"varint,5,opt,name=stabilizationWindowSeconds"` // Metrics to use for scaling Metrics []ScaleMetric `json:"metrics,omitempty" protobuf:"bytes,6,rep,name=metrics"` // Up or Down scaling behavior Behavior *ScaleBehavior `json:"behavior,omitempty" protobuf:"bytes,7,opt,name=behavior"` }
KratosSpec defines the desired state of Kratos
func (*KratosSpec) DeepCopy ¶
func (in *KratosSpec) DeepCopy() *KratosSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KratosSpec.
func (*KratosSpec) DeepCopyInto ¶
func (in *KratosSpec) DeepCopyInto(out *KratosSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KratosStatus ¶
type KratosStatus struct { //Time when stabilization window ends StabilizationEndTime *metav1.Time `json:"stabilizationEndTime,omitempty" protobuf:"bytes,1,opt,name=stabilizationEndTime"` //current target replicas CurrentReplicas int32 `json:"currentReplicas" protobuf:"varint,2,opt,name=currentReplicas"` //desired number of replicas for target DesiredReplicas int32 `json:"desiredReplicas" protobuf:"varint,3,opt,name=desiredReplicas"` //scale recommendations Recommendations []Recommendation `json:"recommendations" protobuf:"varint,4,opt,name=recommendations"` //scale up events ScaleUpEvents []ScaleChangeEvent `json:"scaleUpEvents" protobuf:"varint,5,opt,name=scaleUpEvents"` //scale down events ScaleDownEvents []ScaleChangeEvent `json:"scaleDownEvents" protobuf:"varint,6,opt,name=scaleDownEvents"` }
KratosStatus defines the observed state of Kratos
func (*KratosStatus) DeepCopy ¶
func (in *KratosStatus) DeepCopy() *KratosStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KratosStatus.
func (*KratosStatus) DeepCopyInto ¶
func (in *KratosStatus) DeepCopyInto(out *KratosStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MetricIdentifier ¶
type MetricIdentifier struct { // name is the name of the given metric Name string `json:"name" protobuf:"bytes,1,name=name"` // selector is the string-encoded form of a standard kubernetes label selector for the given metric // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. // When unset, just the metricName will be used to gather metrics. // +optional Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,name=selector"` }
MetricIdentifier defines the name and optionally selector for a metric
func (*MetricIdentifier) DeepCopy ¶
func (in *MetricIdentifier) DeepCopy() *MetricIdentifier
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricIdentifier.
func (*MetricIdentifier) DeepCopyInto ¶
func (in *MetricIdentifier) DeepCopyInto(out *MetricIdentifier)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MetricTarget ¶
type MetricTarget struct { // type represents whether the metric type is Utilization, Value, or AverageValue Type MetricTargetType `json:"type" protobuf:"bytes,1,name=type"` // value is the target value of the metric (as a quantity). // +optional Value *resource.Quantity `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` // averageValue is the target value of the average of the // metric across all relevant pods (as a quantity) // +optional AverageValue *resource.Quantity `json:"averageValue,omitempty" protobuf:"bytes,3,opt,name=averageValue"` // averageUtilization is the target value of the average of the // resource metric across all relevant pods, represented as a percentage of // the requested value of the resource for the pods. // Currently only valid for Resource metric source type // +optional AverageUtilization *int32 `json:"averageUtilization,omitempty" protobuf:"bytes,4,opt,name=averageUtilization"` }
MetricTarget defines the target value, average value, or average utilization of a specific metric
func (*MetricTarget) DeepCopy ¶
func (in *MetricTarget) DeepCopy() *MetricTarget
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricTarget.
func (*MetricTarget) DeepCopyInto ¶
func (in *MetricTarget) DeepCopyInto(out *MetricTarget)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MetricTargetType ¶
type MetricTargetType string
MetricTargetType specifies the type of metric being targeted, and should be either "Value", "AverageValue", or "Utilization"
const ( // UtilizationMetricType declares a MetricTarget is an AverageUtilization value UtilizationMetricType MetricTargetType = "Utilization" // ValueMetricType declares a MetricTarget is a raw value ValueMetricType MetricTargetType = "Value" // AverageValueMetricType declares a MetricTarget is an average across all relevant pods (as a quantity) AverageValueMetricType MetricTargetType = "AverageValue" )
type MetricType ¶
type MetricType string
const ( ResourceScaleMetricType MetricType = "Resource" PodScaleMetricType MetricType = "Pod" ObjectScaleMetricType MetricType = "Object" ExternalScaleMetricType MetricType = "External" PrometheusScaleMetricType MetricType = "Prometheus" )
type ObjectMetricSource ¶
type ObjectMetricSource struct { DescribedObject ScaleTargetReference `json:"describedObject" protobuf:"bytes,1,name=describedObject"` // target specifies the target value for the given metric Target MetricTarget `json:"target" protobuf:"bytes,2,name=target"` // metric identifies the target metric by name and selector Metric MetricIdentifier `json:"metric" protobuf:"bytes,3,name=metric"` }
ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).
func (*ObjectMetricSource) DeepCopy ¶
func (in *ObjectMetricSource) DeepCopy() *ObjectMetricSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMetricSource.
func (*ObjectMetricSource) DeepCopyInto ¶
func (in *ObjectMetricSource) DeepCopyInto(out *ObjectMetricSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodsMetricSource ¶
type PodsMetricSource struct { // metric identifies the target metric by name and selector Metric MetricIdentifier `json:"metric" protobuf:"bytes,1,name=metric"` // target specifies the target value for the given metric Target MetricTarget `json:"target" protobuf:"bytes,2,name=target"` }
PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.
func (*PodsMetricSource) DeepCopy ¶
func (in *PodsMetricSource) DeepCopy() *PodsMetricSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodsMetricSource.
func (*PodsMetricSource) DeepCopyInto ¶
func (in *PodsMetricSource) DeepCopyInto(out *PodsMetricSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PrometheusMetricSource ¶
type PrometheusMetricSource struct { // Metrics query in PromQL language. Must return single value. MetricQuery string `json:"metricQuery" protobuf:"bytes,1,name=metricQuery"` // target specifies the target value for the given metric Target MetricTarget `json:"target" protobuf:"bytes,2,name=target"` //Prometheus endpoint for retrieving metrics. Default to global setting set at the Operator level PrometheusEndpoint string `json:"prometheusEndpoint" protobuf:"bytes,3,name=prometheusEndpoint"` }
func (*PrometheusMetricSource) DeepCopy ¶
func (in *PrometheusMetricSource) DeepCopy() *PrometheusMetricSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusMetricSource.
func (*PrometheusMetricSource) DeepCopyInto ¶
func (in *PrometheusMetricSource) DeepCopyInto(out *PrometheusMetricSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Recommendation ¶
type Recommendation struct { // timestamp of the recommendation Timestamp metav1.Time `json:"timestamp" protobuf:"varint,1,opt,name=timestamp"` // recommended replicas Replicas int32 `json:"replicas" protobuf:"varint,2,opt,name=replicas"` }
Recommendation details
func (*Recommendation) DeepCopy ¶
func (in *Recommendation) DeepCopy() *Recommendation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Recommendation.
func (*Recommendation) DeepCopyInto ¶
func (in *Recommendation) DeepCopyInto(out *Recommendation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceMetricSource ¶
type ResourceMetricSource struct { // name is the name of the resource in question. Name v1.ResourceName `json:"name" protobuf:"bytes,1,name=name"` // target specifies the target value for the given metric Target MetricTarget `json:"target" protobuf:"bytes,2,name=target"` // container is the name of the container in the pods of the scaling target. // +optional Container string `json:"container" protobuf:"bytes,3,opt,name=container"` }
ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. Only one "target" type should be set.
func (*ResourceMetricSource) DeepCopy ¶
func (in *ResourceMetricSource) DeepCopy() *ResourceMetricSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceMetricSource.
func (*ResourceMetricSource) DeepCopyInto ¶
func (in *ResourceMetricSource) DeepCopyInto(out *ResourceMetricSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScaleBehavior ¶
type ScaleBehavior struct { ScaleUp *ScaleRules `json:"scaleUp,omitempty" protobuf:"bytes,1,opt,name=scaleUp"` ScaleDown *ScaleRules `json:"scaleDown,omitempty" protobuf:"bytes,2,opt,name=scaleDown"` }
func (*ScaleBehavior) DeepCopy ¶
func (in *ScaleBehavior) DeepCopy() *ScaleBehavior
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleBehavior.
func (*ScaleBehavior) DeepCopyInto ¶
func (in *ScaleBehavior) DeepCopyInto(out *ScaleBehavior)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScaleChangeEvent ¶
type ScaleChangeEvent struct { // timestamp of the event Timestamp metav1.Time `json:"timestamp" protobuf:"varint,1,opt,name=timestamp"` // change of replicas ReplicaChange int32 `json:"replicaChange" protobuf:"varint,2,opt,name=replicaChange"` }
ScaleChangeEvent holds timestamp and replica delta
func (*ScaleChangeEvent) DeepCopy ¶
func (in *ScaleChangeEvent) DeepCopy() *ScaleChangeEvent
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleChangeEvent.
func (*ScaleChangeEvent) DeepCopyInto ¶
func (in *ScaleChangeEvent) DeepCopyInto(out *ScaleChangeEvent)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScaleMetric ¶
type ScaleMetric struct { Type MetricType `json:"type" protobuf:"bytes,1,name=type"` // resource refers to a resource metric (such as those specified in // requests and limits) known to Kubernetes describing each pod in the // current scale target (e.g. CPU or memory). Such metrics are built in to // Kubernetes, and have special scaling options on top of those available // to normal per-pod metrics using the "pods" source. // +optional Resource *ResourceMetricSource `json:"resource,omitempty" protobuf:"bytes,1,opt,name=resource"` // pods refers to a metric describing each pod in the current scale target // (for example, transactions-processed-per-second). The values will be // averaged together before being compared to the target value. // +optional Pods *PodsMetricSource `json:"pods,omitempty" protobuf:"bytes,2,opt,name=pods"` // object refers to a metric describing a single kubernetes object // (for example, hits-per-second on an Ingress object). // +optional Object *ObjectMetricSource `json:"object,omitempty" protobuf:"bytes,3,opt,name=object"` // external refers to a global metric that is not associated // with any Kubernetes object. It allows autoscaling based on information // coming from components running outside of cluster // (for example length of queue in cloud messaging service, or // QPS from loadbalancer running outside of cluster). // +optional External *ExternalMetricSource `json:"external,omitempty" protobuf:"bytes,5,opt,name=external"` Prometheus *PrometheusMetricSource `json:"prometheus,omitempty" protobuf:"bytes,6,opt,name=prometheus"` }
func (*ScaleMetric) DeepCopy ¶
func (in *ScaleMetric) DeepCopy() *ScaleMetric
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleMetric.
func (*ScaleMetric) DeepCopyInto ¶
func (in *ScaleMetric) DeepCopyInto(out *ScaleMetric)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ScaleMetric) GetMetricTarget ¶
func (sm *ScaleMetric) GetMetricTarget() (*MetricTarget, error)
type ScaleRules ¶
type ScaleRules struct { // StabilizationWindowSeconds is the number of seconds for which past recommendations should be // considered while scaling up or scaling down. // StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). // If not set, use the default values: // - For scale up: 0 (i.e. no stabilization is done). // - For scale down: 300 (i.e. the stabilization window is 300 seconds long). // +optional StabilizationWindowSeconds int32 `json:"stabilizationWindowSeconds" protobuf:"varint,1,opt,name=stabilizationWindowSeconds"` // selectPolicy is used to specify which policy should be used. // If not set, the default value MaxPolicySelect is used. // +optional SelectPolicy ScalingPolicySelect `json:"selectPolicy,omitempty" protobuf:"bytes,2,opt,name=selectPolicy"` // policies is a list of potential scaling polices which can be used during scaling. // At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid // +optional Policies []ScalingPolicy `json:"policies,omitempty" protobuf:"bytes,3,rep,name=policies"` }
func (*ScaleRules) DeepCopy ¶
func (in *ScaleRules) DeepCopy() *ScaleRules
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRules.
func (*ScaleRules) DeepCopyInto ¶
func (in *ScaleRules) DeepCopyInto(out *ScaleRules)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScaleTargetReference ¶
type ScaleTargetReference struct { Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` Name string `json:"name" protobuf:"bytes,2,opt,name=name"` // API version of the referent // +optional APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"` }
ScalingTargetReference identifies target to scale
func (*ScaleTargetReference) DeepCopy ¶
func (in *ScaleTargetReference) DeepCopy() *ScaleTargetReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleTargetReference.
func (*ScaleTargetReference) DeepCopyInto ¶
func (in *ScaleTargetReference) DeepCopyInto(out *ScaleTargetReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScalingPolicy ¶
type ScalingPolicy struct { // Type is used to specify the scaling policy. Type ScalingPolicyType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ScalingPolicyType"` // Value contains the amount of change which is permitted by the policy. // It must be greater than zero Value int32 `json:"value" protobuf:"varint,2,opt,name=value"` // PeriodSeconds specifies the window of time for which the policy should hold true. // PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min). PeriodSeconds int32 `json:"periodSeconds" protobuf:"varint,3,opt,name=periodSeconds"` }
ScalingPolicy is a single policy which must hold true for a specified past interval.
func (*ScalingPolicy) DeepCopy ¶
func (in *ScalingPolicy) DeepCopy() *ScalingPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScalingPolicy.
func (*ScalingPolicy) DeepCopyInto ¶
func (in *ScalingPolicy) DeepCopyInto(out *ScalingPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScalingPolicySelect ¶
type ScalingPolicySelect string
ScalingPolicySelect is used to specify which policy should be used while scaling in a certain direction
const ( // MaxPolicySelect selects the policy with the highest possible change. MaxPolicySelect ScalingPolicySelect = "Max" // MinPolicySelect selects the policy with the lowest possible change. MinPolicySelect ScalingPolicySelect = "Min" // DisabledPolicySelect disables the scaling in this direction. DisabledPolicySelect ScalingPolicySelect = "Disabled" )
type ScalingPolicyType ¶
type ScalingPolicyType string
ScalingPolicyType is the type of the policy which could be used while making scaling decisions.
const ( // PodsScalingPolicy is a policy used to specify a change in absolute number of pods. PodsScalingPolicy ScalingPolicyType = "Pods" // PercentScalingPolicy is a policy used to specify a relative amount of change with respect to // the current number of pods. PercentScalingPolicy ScalingPolicyType = "Percent" )