v1alpha2

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package v1alpha2 provides alpha API for Katalyst Autoscaling API objects.

Index

Constants

View Source
const (
	// GroupName is the group name used in this package
	GroupName string = "autoscaling.katalyst.kubewharf.io"
)
View Source
const (
	ResourceNameKatalystVPA = "katalystverticalpodautoscalers"
)

ResourceName 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: "v1alpha2"}

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 KatalystVerticalPodAutoscaler

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

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

	// Status represents the current information about a KatalystVerticalPodAutoscaler.
	// +optional
	Status KatalystVerticalPodAutoscalerStatus `json:"status,omitempty"`
}

KatalystVerticalPodAutoscaler captures information about a VPA object

func (*KatalystVerticalPodAutoscaler) DeepCopy

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

func (*KatalystVerticalPodAutoscaler) DeepCopyInto

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

func (*KatalystVerticalPodAutoscaler) DeepCopyObject

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

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

type KatalystVerticalPodAutoscalerList

type KatalystVerticalPodAutoscalerList 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 KatalystVerticalPodAutoscalers
	Items []KatalystVerticalPodAutoscaler `json:"items"`
}

KatalystVerticalPodAutoscalerList is a collection of KatalystVerticalPodAutoscaler objects.

func (*KatalystVerticalPodAutoscalerList) DeepCopy

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

func (*KatalystVerticalPodAutoscalerList) DeepCopyInto

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

func (*KatalystVerticalPodAutoscalerList) DeepCopyObject

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

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

type KatalystVerticalPodAutoscalerSpec

type KatalystVerticalPodAutoscalerSpec struct {
	// TargetRef points to the controller managing the set of pods for the
	// autoscaler to control - e.g. Deployment, StatefulSet.
	TargetRef recommendationapi.CrossVersionObjectReference `json:"targetRef"`

	// Controls how the autoscaler computes recommended resources.
	// The resource policy may be 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 recommendationapi.ResourcePolicy `json:"resourcePolicy,omitempty"`

	// 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"`
}

KatalystVerticalPodAutoscalerSpec is the specification of the behavior of the autoscaler.

func (*KatalystVerticalPodAutoscalerSpec) DeepCopy

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

func (*KatalystVerticalPodAutoscalerSpec) DeepCopyInto

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

type KatalystVerticalPodAutoscalerStatus

type KatalystVerticalPodAutoscalerStatus struct {
	// RecommendResources is the last recommendation of resources computed by
	// recommenders
	// +optional
	RecommendResources recommendationapi.RecommendResources `json:"recommendResources,omitempty"`

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

KatalystVerticalPodAutoscalerStatus describes the runtime state of the autoscaler.

func (*KatalystVerticalPodAutoscalerStatus) DeepCopy

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

func (*KatalystVerticalPodAutoscalerStatus) DeepCopyInto

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

type PodApplyStrategy

type PodApplyStrategy string

PodApplyStrategy controls the applying scope autoscaler should obey to. +kubebuilder:validation:Enum=Pod;Group

const (
	// PodApplyStrategyStrategyPod means that autoscaler consider each pod as individual one,
	// the applied status (successes or failed) would affect each other pod.
	PodApplyStrategyStrategyPod PodApplyStrategy = "Pod"
	// PodApplyStrategyStrategyGroup means that autoscaler must make sure the recommendation for pods
	// can be applied before it performs updating actions.
	PodApplyStrategyStrategyGroup PodApplyStrategy = "Group"
)

type PodMatchingStrategy

type PodMatchingStrategy string

PodMatchingStrategy controls the timing autoscaler applies changes to the pod resources. +kubebuilder:validation:Enum=PodMatchingStrategyForHistoricalPod;PodMatchingStrategyForFreshPod;All

const (
	// PodMatchingStrategyForHistoricalPod means that autoscaler will only apply resources
	// for pods that are created before this VPA CR.
	PodMatchingStrategyForHistoricalPod PodMatchingStrategy = "ForHistoricalPod"
	// PodMatchingStrategyForFreshPod means that autoscaler assigns resources on pod
	// creation and also change them during the lifetime of the pod. Pods that are created before
	// this VPA CR won't be changed.
	PodMatchingStrategyForFreshPod PodMatchingStrategy = "ForFreshPod"
	// PodMatchingStrategyAll means that autoscaler will reconcile and update all pods
	// that match up with the target reference.
	PodMatchingStrategyAll PodMatchingStrategy = "All"
)

type PodUpdatePolicy

type PodUpdatePolicy struct {
	// PodUpdatingStrategy controls the method autoscaler applies changes to the pod resources.
	// The default is 'Off'.
	// +kubebuilder:default:=Off
	PodUpdatingStrategy PodUpdatingStrategy `json:"podUpdatingStrategy,omitempty"`

	// PodMatchingStrategy controls the timing autoscaler applies changes to the pod resources.
	// The default is 'All'.
	// +kubebuilder:default:=All
	PodMatchingStrategy PodMatchingStrategy `json:"podMatchingStrategy,omitempty"`

	// PodApplyStrategy controls the applying scope autoscaler should obey to.
	// The default is 'Group'.
	// +kubebuilder:default:=Group
	PodApplyStrategy PodApplyStrategy `json:"podApplyStrategy,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 PodUpdatingStrategy

type PodUpdatingStrategy string

PodUpdatingStrategy controls the method autoscaler applies changes to the pod resources. +kubebuilder:validation:Enum=Off;Recreate;Inplace;BestEffortInplace

const (
	// PodUpdatingStrategyOff means that autoscaler never changes Pod resources.
	// The provider still sets the resources in the KatalystVerticalPodAutoscaler object.
	// This can be used for a "dry run".
	PodUpdatingStrategyOff PodUpdatingStrategy = "Off"

	// PodUpdatingStrategyRecreate means that autoscaler assigns resources on pod
	// creation and additionally can update them during the lifetime of the
	// pod by always deleting and recreating the pod.
	PodUpdatingStrategyRecreate PodUpdatingStrategy = "Recreate"

	// PodUpdatingStrategyInplace means that autoscaler assigns resources only
	// during the lifetime of pod without re-creating the pod
	PodUpdatingStrategyInplace PodUpdatingStrategy = "Inplace"

	// PodUpdatingStrategyBestEffortInplace means that autoscaler will try to inplace
	// update resources, and fallback to recreate if not available.
	PodUpdatingStrategyBestEffortInplace PodUpdatingStrategy = "BestEffortInplace"
)

type VerticalPodAutoscalerCondition

type VerticalPodAutoscalerCondition struct {
	// type describes the current condition
	Type VerticalPodAutoscalerConditionType `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"`
}

VerticalPodAutoscalerCondition describes the state of a KatalystVerticalPodAutoscaler at a certain point.

func (*VerticalPodAutoscalerCondition) DeepCopy

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

func (*VerticalPodAutoscalerCondition) DeepCopyInto

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

type VerticalPodAutoscalerConditionType

type VerticalPodAutoscalerConditionType string

VerticalPodAutoscalerConditionType are the valid conditions of a KatalystVerticalPodAutoscaler.

const (
	// NoPodsMatched indicates that target reference used with VPA object didn't match any pods.
	NoPodsMatched VerticalPodAutoscalerConditionType = "NoPodsMatched"
	// RecommendationUpdated indicates that the recommendation was written in Pod Annotations
	RecommendationUpdated VerticalPodAutoscalerConditionType = "RecommendationUpdated"
	// RecommendationApplied indicates that the recommendation was finally applied in Pod
	RecommendationApplied VerticalPodAutoscalerConditionType = "RecommendationApplied"
)

Jump to

Keyboard shortcuts

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