v1alpha1

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API. +k8s:deepcopy-gen=package,register +k8s:openapi-gen=true +groupName=autoscaling.karmada.io

Index

Constants

View Source
const (
	// FederatedHPAKind is the kind of FederatedHPA in group autoscaling.karmada.io
	FederatedHPAKind = "FederatedHPA"

	// QuerySourceAnnotationKey is the annotation used in karmada-metrics-adapter to
	// record the query source cluster
	QuerySourceAnnotationKey = "resource.karmada.io/query-from-cluster"

	// ResourceSingularFederatedHPA is singular name of FederatedHPA.
	ResourceSingularFederatedHPA = "federatedhpa"
	// ResourcePluralFederatedHPA is plural name of FederatedHPA.
	ResourcePluralFederatedHPA = "federatedhpas"
	// ResourceNamespaceScopedFederatedHPA is the scope of the FederatedHPA
	ResourceNamespaceScopedFederatedHPA = true

	// ResourceKindCronFederatedHPA is kind name of CronFederatedHPA.
	ResourceKindCronFederatedHPA = "CronFederatedHPA"
	// ResourceSingularCronFederatedHPA is singular name of CronFederatedHPA.
	ResourceSingularCronFederatedHPA = "cronfederatedhpa"
	// ResourcePluralCronFederatedHPA is plural name of CronFederatedHPA.
	ResourcePluralCronFederatedHPA = "cronfederatedhpas"
	// ResourceNamespaceScopedCronFederatedHPA is the scope of the CronFederatedHPA
	ResourceNamespaceScopedCronFederatedHPA = true
)
View Source
const GroupName = "autoscaling.karmada.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 CronFederatedHPA added in v1.7.0

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

	// Spec is the specification of the CronFederatedHPA.
	// +required
	Spec CronFederatedHPASpec `json:"spec"`

	// Status is the current status of the CronFederatedHPA.
	// +optional
	Status CronFederatedHPAStatus `json:"status"`
}

CronFederatedHPA represents a collection of repeating schedule to scale replica number of a specific workload. It can scale any resource implementing the scale subresource as well as FederatedHPA.

func (*CronFederatedHPA) DeepCopy added in v1.7.0

func (in *CronFederatedHPA) DeepCopy() *CronFederatedHPA

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

func (*CronFederatedHPA) DeepCopyInto added in v1.7.0

func (in *CronFederatedHPA) DeepCopyInto(out *CronFederatedHPA)

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

func (*CronFederatedHPA) DeepCopyObject added in v1.7.0

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

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

type CronFederatedHPAList added in v1.7.0

type CronFederatedHPAList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CronFederatedHPA `json:"items"`
}

CronFederatedHPAList contains a list of CronFederatedHPA.

func (*CronFederatedHPAList) DeepCopy added in v1.7.0

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

func (*CronFederatedHPAList) DeepCopyInto added in v1.7.0

func (in *CronFederatedHPAList) DeepCopyInto(out *CronFederatedHPAList)

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

func (*CronFederatedHPAList) DeepCopyObject added in v1.7.0

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

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

type CronFederatedHPARule added in v1.7.0

type CronFederatedHPARule struct {
	// Name of the rule.
	// Each rule in a CronFederatedHPA must have a unique name.
	//
	// Note: the name will be used as an identifier to record its execution
	// history. Changing the name will be considered as deleting the old rule
	// and adding a new rule, that means the original execution history will be
	// discarded.
	//
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=32
	// +required
	Name string `json:"name"`

	// Schedule is the cron expression that represents a periodical time.
	// The syntax follows https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#schedule-syntax.
	// +required
	Schedule string `json:"schedule"`

	// TargetReplicas is the target replicas to be scaled for resources
	// referencing by ScaleTargetRef of this CronFederatedHPA.
	// Only needed when referencing resource is not FederatedHPA.
	// +optional
	TargetReplicas *int32 `json:"targetReplicas,omitempty"`

	// TargetMinReplicas is the target MinReplicas to be set for FederatedHPA.
	// Only needed when referencing resource is FederatedHPA.
	// TargetMinReplicas and TargetMaxReplicas can be specified together or
	// either one can be specified alone.
	// nil means the MinReplicas(.spec.minReplicas) of the referencing FederatedHPA
	// will not be updated.
	// +optional
	TargetMinReplicas *int32 `json:"targetMinReplicas,omitempty"`

	// TargetMaxReplicas is the target MaxReplicas to be set for FederatedHPA.
	// Only needed when referencing resource is FederatedHPA.
	// TargetMinReplicas and TargetMaxReplicas can be specified together or
	// either one can be specified alone.
	// nil means the MaxReplicas(.spec.maxReplicas) of the referencing FederatedHPA
	// will not be updated.
	// +optional
	TargetMaxReplicas *int32 `json:"targetMaxReplicas,omitempty"`

	// Suspend tells the controller to suspend subsequent executions.
	// Defaults to false.
	//
	// +kubebuilder:default=false
	// +optional
	Suspend *bool `json:"suspend,omitempty"`

	// TimeZone for the giving schedule.
	// If not specified, this will default to the time zone of the
	// karmada-controller-manager process.
	// Invalid TimeZone will be rejected when applying by karmada-webhook.
	// see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the
	// all timezones.
	// +optional
	TimeZone *string `json:"timeZone,omitempty"`

	// SuccessfulHistoryLimit represents the count of successful execution items
	// for each rule.
	// The value must be a positive integer. It defaults to 3.
	//
	// +kubebuilder:default=3
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=32
	// +optional
	SuccessfulHistoryLimit *int32 `json:"successfulHistoryLimit,omitempty"`

	// FailedHistoryLimit represents the count of failed execution items for
	// each rule.
	// The value must be a positive integer. It defaults to 3.
	//
	// +kubebuilder:default=3
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=32
	FailedHistoryLimit *int32 `json:"failedHistoryLimit,omitempty"`
}

CronFederatedHPARule declares a schedule as well as scale actions.

func (*CronFederatedHPARule) DeepCopy added in v1.7.0

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

func (*CronFederatedHPARule) DeepCopyInto added in v1.7.0

func (in *CronFederatedHPARule) DeepCopyInto(out *CronFederatedHPARule)

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

type CronFederatedHPASpec added in v1.7.0

type CronFederatedHPASpec struct {
	// ScaleTargetRef points to the target resource to scale.
	// Target resource could be any resource that implementing the scale
	// subresource like Deployment, or FederatedHPA.
	// +required
	ScaleTargetRef autoscalingv2.CrossVersionObjectReference `json:"scaleTargetRef"`

	// Rules contains a collection of schedules that declares when and how
	// the referencing target resource should be scaled.
	// +required
	Rules []CronFederatedHPARule `json:"rules"`
}

CronFederatedHPASpec is the specification of the CronFederatedHPA.

func (*CronFederatedHPASpec) DeepCopy added in v1.7.0

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

func (*CronFederatedHPASpec) DeepCopyInto added in v1.7.0

func (in *CronFederatedHPASpec) DeepCopyInto(out *CronFederatedHPASpec)

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

type CronFederatedHPAStatus added in v1.7.0

type CronFederatedHPAStatus struct {
	// ExecutionHistories record the execution histories of CronFederatedHPARule.
	// +optional
	ExecutionHistories []ExecutionHistory `json:"executionHistories,omitempty"`
}

CronFederatedHPAStatus represents the current status of a CronFederatedHPA.

func (*CronFederatedHPAStatus) DeepCopy added in v1.7.0

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

func (*CronFederatedHPAStatus) DeepCopyInto added in v1.7.0

func (in *CronFederatedHPAStatus) DeepCopyInto(out *CronFederatedHPAStatus)

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

type ExecutionHistory added in v1.7.0

type ExecutionHistory struct {
	// RuleName is the name of the CronFederatedHPARule.
	// +required
	RuleName string `json:"ruleName"`

	// NextExecutionTime is the next time to execute.
	// Nil means the rule has been suspended.
	// +optional
	NextExecutionTime *metav1.Time `json:"nextExecutionTime,omitempty"`

	// SuccessfulExecutions records successful executions.
	// +optional
	SuccessfulExecutions []SuccessfulExecution `json:"successfulExecutions,omitempty"`

	// FailedExecutions records failed executions.
	// +optional
	FailedExecutions []FailedExecution `json:"failedExecutions,omitempty"`
}

ExecutionHistory records the execution history of specific CronFederatedHPARule.

func (*ExecutionHistory) DeepCopy added in v1.7.0

func (in *ExecutionHistory) DeepCopy() *ExecutionHistory

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

func (*ExecutionHistory) DeepCopyInto added in v1.7.0

func (in *ExecutionHistory) DeepCopyInto(out *ExecutionHistory)

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

type FailedExecution added in v1.7.0

type FailedExecution struct {
	// ScheduleTime is the expected execution time declared in CronFederatedHPARule.
	// +required
	ScheduleTime *metav1.Time `json:"scheduleTime"`

	// ExecutionTime is the actual execution time of CronFederatedHPARule.
	// Tasks may not always be executed at ScheduleTime. ExecutionTime is used
	// to evaluate the efficiency of the controller's execution.
	// +required
	ExecutionTime *metav1.Time `json:"executionTime"`

	// Message is the human-readable message indicating details about the failure.
	// +required
	Message string `json:"message"`
}

FailedExecution records a failed execution.

func (*FailedExecution) DeepCopy added in v1.7.0

func (in *FailedExecution) DeepCopy() *FailedExecution

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

func (*FailedExecution) DeepCopyInto added in v1.7.0

func (in *FailedExecution) DeepCopyInto(out *FailedExecution)

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

type FederatedHPA

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

	// Spec is the specification of the FederatedHPA.
	// +required
	Spec FederatedHPASpec `json:"spec"`

	// Status is the current status of the FederatedHPA.
	// +optional
	Status autoscalingv2.HorizontalPodAutoscalerStatus `json:"status"`
}

FederatedHPA is centralized HPA that can aggregate the metrics in multiple clusters. When the system load increases, it will query the metrics from multiple clusters and scales up the replicas. When the system load decreases, it will query the metrics from multiple clusters and scales down the replicas. After the replicas are scaled up/down, karmada-scheduler will schedule the replicas based on the policy.

func (*FederatedHPA) DeepCopy

func (in *FederatedHPA) DeepCopy() *FederatedHPA

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

func (*FederatedHPA) DeepCopyInto

func (in *FederatedHPA) DeepCopyInto(out *FederatedHPA)

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

func (*FederatedHPA) DeepCopyObject

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

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

type FederatedHPAList

type FederatedHPAList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []FederatedHPA `json:"items"`
}

FederatedHPAList contains a list of FederatedHPA.

func (*FederatedHPAList) DeepCopy

func (in *FederatedHPAList) DeepCopy() *FederatedHPAList

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

func (*FederatedHPAList) DeepCopyInto

func (in *FederatedHPAList) DeepCopyInto(out *FederatedHPAList)

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

func (*FederatedHPAList) DeepCopyObject

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

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

type FederatedHPASpec

type FederatedHPASpec struct {
	// ScaleTargetRef points to the target resource to scale, and is used to
	// the pods for which metrics should be collected, as well as to actually
	// change the replica count.
	// +required
	ScaleTargetRef autoscalingv2.CrossVersionObjectReference `json:"scaleTargetRef"`

	// MinReplicas is the lower limit for the number of replicas to which the
	// autoscaler can scale down.
	// It defaults to 1 pod.
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`

	// MaxReplicas is the upper limit for the number of replicas to which the
	// autoscaler can scale up.
	// It cannot be less that minReplicas.
	MaxReplicas int32 `json:"maxReplicas"`

	// Metrics contains the specifications for which to use to calculate the
	// desired replica count (the maximum replica count across all metrics will
	// be used). The desired replica count is calculated multiplying the
	// ratio between the target value and the current value by the current
	// number of pods. Ergo, metrics used must decrease as the pod count is
	// increased, and vice-versa. See the individual metric source types for
	// more information about how each type of metric must respond.
	// If not set, the default metric will be set to 80% average CPU utilization.
	// +optional
	Metrics []autoscalingv2.MetricSpec `json:"metrics,omitempty"`

	// Behavior configures the scaling behavior of the target
	// in both Up and Down directions (scaleUp and scaleDown fields respectively).
	// If not set, the default HPAScalingRules for scale up and scale down are used.
	// +optional
	Behavior *autoscalingv2.HorizontalPodAutoscalerBehavior `json:"behavior,omitempty"`
}

FederatedHPASpec describes the desired functionality of the FederatedHPA.

func (*FederatedHPASpec) DeepCopy

func (in *FederatedHPASpec) DeepCopy() *FederatedHPASpec

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

func (*FederatedHPASpec) DeepCopyInto

func (in *FederatedHPASpec) DeepCopyInto(out *FederatedHPASpec)

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

type SuccessfulExecution added in v1.7.0

type SuccessfulExecution struct {
	// ScheduleTime is the expected execution time declared in CronFederatedHPARule.
	// +required
	ScheduleTime *metav1.Time `json:"scheduleTime"`

	// ExecutionTime is the actual execution time of CronFederatedHPARule.
	// Tasks may not always be executed at ScheduleTime. ExecutionTime is used
	// to evaluate the efficiency of the controller's execution.
	// +required
	ExecutionTime *metav1.Time `json:"executionTime"`

	// AppliedReplicas is the replicas have been applied.
	// It is required if .spec.rules[*].targetReplicas is not empty.
	// +optional
	AppliedReplicas *int32 `json:"appliedReplicas,omitempty"`

	// AppliedMaxReplicas is the MaxReplicas have been applied.
	// It is required if .spec.rules[*].targetMaxReplicas is not empty.
	// +optional
	AppliedMaxReplicas *int32 `json:"appliedMaxReplicas,omitempty"`

	// AppliedMinReplicas is the MinReplicas have been applied.
	// It is required if .spec.rules[*].targetMinReplicas is not empty.
	// +optional
	AppliedMinReplicas *int32 `json:"appliedMinReplicas,omitempty"`
}

SuccessfulExecution records a successful execution.

func (*SuccessfulExecution) DeepCopy added in v1.7.0

func (in *SuccessfulExecution) DeepCopy() *SuccessfulExecution

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

func (*SuccessfulExecution) DeepCopyInto added in v1.7.0

func (in *SuccessfulExecution) DeepCopyInto(out *SuccessfulExecution)

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