Documentation ¶
Overview ¶
Package v1beta3 contains API Schema definitions for the autoscaling v1beta3 API group +kubebuilder:object:generate=true +groupName=autoscaling.mercari.com
Index ¶
- Constants
- Variables
- func TortoiseDefaultHPAName(tortoiseName string) string
- type AutoscalingType
- type Conditions
- type ContainerAutoscalingPolicy
- type ContainerRecommendationFromVPA
- type ContainerResourcePhase
- type ContainerResourcePhases
- type ContainerResourcePolicy
- type CrossVersionObjectReference
- type DeletionPolicy
- type HPATargetUtilizationRecommendationPerContainer
- type HorizontalRecommendations
- type Recommendations
- type RecommendedContainerResources
- type ReplicasRecommendation
- type ResourcePhase
- type ResourceQuantity
- type TargetRefs
- type TargetStatusVerticalPodAutoscaler
- type TargetsStatus
- type Tortoise
- func (in *Tortoise) DeepCopy() *Tortoise
- func (in *Tortoise) DeepCopyInto(out *Tortoise)
- func (in *Tortoise) DeepCopyObject() runtime.Object
- func (r *Tortoise) Default()
- func (*Tortoise) Hub()
- func (r *Tortoise) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (r *Tortoise) ValidateCreate() (admission.Warnings, error)
- func (r *Tortoise) ValidateDelete() (admission.Warnings, error)
- func (r *Tortoise) ValidateUpdate(old runtime.Object) (admission.Warnings, error)
- type TortoiseCondition
- type TortoiseConditionType
- type TortoiseList
- type TortoisePhase
- type TortoiseSpec
- type TortoiseStatus
- type UpdateMode
- type VerticalPodAutoscalerRole
- type VerticalRecommendations
Constants ¶
const ( VerticalPodAutoscalerRoleUpdater = "Updater" VerticalPodAutoscalerRoleMonitor = "Monitor" )
const TortoiseDefaultHPANamePrefix = "tortoise-hpa-"
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "autoscaling.mercari.com", Version: "v1beta3"} // 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 )
var ClientService *service
Functions ¶
func TortoiseDefaultHPAName ¶
Types ¶
type AutoscalingType ¶
type AutoscalingType string
+kubebuilder:validation:Enum=Off;Horizontal;Vertical
const ( AutoscalingTypeOff AutoscalingType = "Off" AutoscalingTypeHorizontal AutoscalingType = "Horizontal" AutoscalingTypeVertical AutoscalingType = "Vertical" )
type Conditions ¶
type Conditions struct { // TortoiseConditions is the condition of this tortoise. // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type // +optional TortoiseConditions []TortoiseCondition `json:"tortoiseConditions" protobuf:"bytes,1,name=tortoiseConditions"` // ContainerRecommendationFromVPA is the condition of container recommendation from VPA, which is observed last time. // +optional ContainerRecommendationFromVPA []ContainerRecommendationFromVPA `json:"containerRecommendationFromVPA,omitempty" protobuf:"bytes,1,opt,name=containerRecommendationFromVPA"` }
func (*Conditions) DeepCopy ¶
func (in *Conditions) DeepCopy() *Conditions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions.
func (*Conditions) DeepCopyInto ¶
func (in *Conditions) DeepCopyInto(out *Conditions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ContainerAutoscalingPolicy ¶
type ContainerAutoscalingPolicy struct { // ContainerName is the name of target container. ContainerName string `json:"containerName" protobuf:"bytes,1,name=containerName"` // Policy specifies how each resource is scaled. // See .spec.AutoscalingPolicy for more defail. Policy map[v1.ResourceName]AutoscalingType `json:"policy,omitempty" protobuf:"bytes,2,opt,name=policy"` }
func (*ContainerAutoscalingPolicy) DeepCopy ¶
func (in *ContainerAutoscalingPolicy) DeepCopy() *ContainerAutoscalingPolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerAutoscalingPolicy.
func (*ContainerAutoscalingPolicy) DeepCopyInto ¶
func (in *ContainerAutoscalingPolicy) DeepCopyInto(out *ContainerAutoscalingPolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ContainerRecommendationFromVPA ¶
type ContainerRecommendationFromVPA struct { // ContainerName is the name of target container. ContainerName string `json:"containerName" protobuf:"bytes,1,name=containerName"` // MaxRecommendation is the max recommendation value from VPA in a certain period (1 week). // Tortoise generates all recommendation based on this MaxRecommendation. MaxRecommendation map[v1.ResourceName]ResourceQuantity `json:"maxRecommendation" protobuf:"bytes,2,name=maxRecommendation"` // Recommendation is the recommendation value from VPA that the tortoise controller observed in the last reconciliation.. Recommendation map[v1.ResourceName]ResourceQuantity `json:"recommendation" protobuf:"bytes,3,name=recommendation"` }
func (*ContainerRecommendationFromVPA) DeepCopy ¶
func (in *ContainerRecommendationFromVPA) DeepCopy() *ContainerRecommendationFromVPA
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerRecommendationFromVPA.
func (*ContainerRecommendationFromVPA) DeepCopyInto ¶
func (in *ContainerRecommendationFromVPA) DeepCopyInto(out *ContainerRecommendationFromVPA)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ContainerResourcePhase ¶
type ContainerResourcePhase string
const ( ContainerResourcePhaseGatheringData ContainerResourcePhase = "GatheringData" ContainerResourcePhaseWorking ContainerResourcePhase = "Working" ContainerResourcePhaseOff ContainerResourcePhase = "Off" )
type ContainerResourcePhases ¶
type ContainerResourcePhases struct { // ContainerName is the name of target container. ContainerName string `json:"containerName" protobuf:"bytes,1,name=containerName"` // ResourcePhases is the phase of each resource of this container. ResourcePhases map[v1.ResourceName]ResourcePhase `json:"resourcePhases" protobuf:"bytes,2,name=resourcePhases"` }
func (*ContainerResourcePhases) DeepCopy ¶
func (in *ContainerResourcePhases) DeepCopy() *ContainerResourcePhases
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerResourcePhases.
func (*ContainerResourcePhases) DeepCopyInto ¶
func (in *ContainerResourcePhases) DeepCopyInto(out *ContainerResourcePhases)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ContainerResourcePolicy ¶
type ContainerResourcePolicy struct { // ContainerName is the name of target container. ContainerName string `json:"containerName" protobuf:"bytes,1,name=containerName"` // MinAllocatedResources is the minimum amount of resources which is given to the container. // Tortoise never set the resources request on the container than MinAllocatedResources. // // If empty, tortoise may reduce the resource request to the value which is suggested from VPA. // Given the VPA suggests values based on the historical resource usage, // you have no choice but to use MinAllocatedResources to pre-scaling your Pods, // for example, when maybe your application change will result in consuming resources more than the past. // +optional MinAllocatedResources v1.ResourceList `json:"minAllocatedResources,omitempty" protobuf:"bytes,2,opt,name=minAllocatedResources"` }
func (*ContainerResourcePolicy) DeepCopy ¶
func (in *ContainerResourcePolicy) DeepCopy() *ContainerResourcePolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerResourcePolicy.
func (*ContainerResourcePolicy) DeepCopyInto ¶
func (in *ContainerResourcePolicy) DeepCopyInto(out *ContainerResourcePolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CrossVersionObjectReference ¶
type CrossVersionObjectReference struct { // kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` // name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names Name string `json:"name" protobuf:"bytes,2,opt,name=name"` // apiVersion is the API version of the referent // +optional APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,3,opt,name=apiVersion"` }
CrossVersionObjectReference contains enough information toet identify the referred resource.
func (*CrossVersionObjectReference) DeepCopy ¶
func (in *CrossVersionObjectReference) DeepCopy() *CrossVersionObjectReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossVersionObjectReference.
func (*CrossVersionObjectReference) DeepCopyInto ¶
func (in *CrossVersionObjectReference) DeepCopyInto(out *CrossVersionObjectReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DeletionPolicy ¶
type DeletionPolicy string
+kubebuilder:validation:Enum=DeleteAll;NoDelete
const ( DeletionPolicyDeleteAll DeletionPolicy = "DeleteAll" DeletionPolicyNoDelete DeletionPolicy = "NoDelete" )
type HPATargetUtilizationRecommendationPerContainer ¶
type HPATargetUtilizationRecommendationPerContainer struct { // ContainerName is the name of target container. ContainerName string `json:"containerName" protobuf:"bytes,1,name=containerName"` // TargetUtilization is the recommendation of targetUtilization of HPA. TargetUtilization map[v1.ResourceName]int32 `json:"targetUtilization" protobuf:"bytes,2,name=targetUtilization"` }
func (*HPATargetUtilizationRecommendationPerContainer) DeepCopy ¶
func (in *HPATargetUtilizationRecommendationPerContainer) DeepCopy() *HPATargetUtilizationRecommendationPerContainer
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HPATargetUtilizationRecommendationPerContainer.
func (*HPATargetUtilizationRecommendationPerContainer) DeepCopyInto ¶
func (in *HPATargetUtilizationRecommendationPerContainer) DeepCopyInto(out *HPATargetUtilizationRecommendationPerContainer)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HorizontalRecommendations ¶
type HorizontalRecommendations struct { // +optional TargetUtilizations []HPATargetUtilizationRecommendationPerContainer `json:"targetUtilizations,omitempty" protobuf:"bytes,1,opt,name=targetUtilizations"` // MaxReplicas has the recommendation of maxReplicas. // It contains the recommendations for each time slot. // +optional MaxReplicas []ReplicasRecommendation `json:"maxReplicas,omitempty" protobuf:"bytes,2,opt,name=maxReplicas"` // MinReplicas has the recommendation of minReplicas. // It contains the recommendations for each time slot. // +optional MinReplicas []ReplicasRecommendation `json:"minReplicas,omitempty" protobuf:"bytes,3,opt,name=minReplicas"` }
func (*HorizontalRecommendations) DeepCopy ¶
func (in *HorizontalRecommendations) DeepCopy() *HorizontalRecommendations
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalRecommendations.
func (*HorizontalRecommendations) DeepCopyInto ¶
func (in *HorizontalRecommendations) DeepCopyInto(out *HorizontalRecommendations)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Recommendations ¶
type Recommendations struct { // +optional Horizontal HorizontalRecommendations `json:"horizontal,omitempty" protobuf:"bytes,1,opt,name=horizontal"` // +optional Vertical VerticalRecommendations `json:"vertical,omitempty" protobuf:"bytes,2,opt,name=vertical"` }
func (*Recommendations) DeepCopy ¶
func (in *Recommendations) DeepCopy() *Recommendations
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Recommendations.
func (*Recommendations) DeepCopyInto ¶
func (in *Recommendations) DeepCopyInto(out *Recommendations)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RecommendedContainerResources ¶
type RecommendedContainerResources struct { // ContainerName is the name of target container. ContainerName string `json:"containerName" protobuf:"bytes,1,name=containerName"` // RecommendedResource is the recommendation calculated by the tortoise. // // If AutoscalingPolicy is vertical, it's the same value as the VPA suggests. // If AutoscalingPolicy is horizontal, it's basically the same value as the current resource request. // But, when the number of replicas are too small or too large, // tortoise may try to increase/decrease the amount of resources given to the container, // so that the number of replicas won't be very small or very large. RecommendedResource v1.ResourceList `json:"RecommendedResource" protobuf:"bytes,2,name=containerName"` }
func (*RecommendedContainerResources) DeepCopy ¶
func (in *RecommendedContainerResources) DeepCopy() *RecommendedContainerResources
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendedContainerResources.
func (*RecommendedContainerResources) DeepCopyInto ¶
func (in *RecommendedContainerResources) DeepCopyInto(out *RecommendedContainerResources)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ReplicasRecommendation ¶
type ReplicasRecommendation struct { // From represented in hour. From int `json:"from" protobuf:"variant,1,name=from"` // To represented in hour. To int `json:"to" protobuf:"variant,2,name=to"` // WeekDay is the day of the week. // If empty, it means it applies to all days of the week. WeekDay *string `json:"weekday,omitempty" protobuf:"bytes,3,opt,name=weekday"` TimeZone string `json:"timezone" protobuf:"bytes,4,name=timezone"` // Value is the recommendation value. // It's calculated every reconciliation, // and updated if the calculated recommendation value is more than the current recommendation value on tortoise. Value int32 `json:"value" protobuf:"variant,5,name=value"` // +optional UpdatedAt metav1.Time `json:"updatedAt,omitempty" protobuf:"bytes,6,opt,name=updatedAt"` }
func (*ReplicasRecommendation) DeepCopy ¶
func (in *ReplicasRecommendation) DeepCopy() *ReplicasRecommendation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicasRecommendation.
func (*ReplicasRecommendation) DeepCopyInto ¶
func (in *ReplicasRecommendation) DeepCopyInto(out *ReplicasRecommendation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourcePhase ¶
type ResourcePhase struct { Phase ContainerResourcePhase `json:"phase" protobuf:"bytes,1,name=phase"` // lastTransitionTime is the last time the condition transitioned from // one status to another // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,2,opt,name=lastTransitionTime"` }
func (*ResourcePhase) DeepCopy ¶
func (in *ResourcePhase) DeepCopy() *ResourcePhase
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePhase.
func (*ResourcePhase) DeepCopyInto ¶
func (in *ResourcePhase) DeepCopyInto(out *ResourcePhase)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceQuantity ¶
type ResourceQuantity struct { // +optional Quantity resource.Quantity `json:"quantity,omitempty" protobuf:"bytes,1,opt,name=quantity"` // +optional UpdatedAt metav1.Time `json:"updatedAt,omitempty" protobuf:"bytes,2,opt,name=updatedAt"` }
func (*ResourceQuantity) DeepCopy ¶
func (in *ResourceQuantity) DeepCopy() *ResourceQuantity
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuantity.
func (*ResourceQuantity) DeepCopyInto ¶
func (in *ResourceQuantity) DeepCopyInto(out *ResourceQuantity)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TargetRefs ¶
type TargetRefs struct { // ScaleTargetRef is the target of scaling. // It should be the same as the target of HPA. ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef" protobuf:"bytes,1,name=scaleTargetRef"` // HorizontalPodAutoscalerName is the name of the target HPA. // The target of this HPA should be the same as the ScaleTargetRef above. // The target HPA should have the ContainerResource type metric that refers to the container resource utilization. // Please check out the document for more detail: https://github.com/mercari/tortoise/blob/master/docs/horizontal.md#attach-your-hpa // Also, note that you must not edit the HPA directly after you attach the HPA to the tortoise of Auto mode. // Even if you edit your HPA in that case, tortoise will overwrite the HPA with the metrics/values. // // You can specify either of existing HPA only. // This is an optional field, and if you don't specify this field, tortoise will create a new default HPA named `tortoise-hpa-{tortoise name}`. // +optional HorizontalPodAutoscalerName *string `json:"horizontalPodAutoscalerName,omitempty" protobuf:"bytes,2,opt,name=horizontalPodAutoscalerName"` }
func (*TargetRefs) DeepCopy ¶
func (in *TargetRefs) DeepCopy() *TargetRefs
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetRefs.
func (*TargetRefs) DeepCopyInto ¶
func (in *TargetRefs) DeepCopyInto(out *TargetRefs)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TargetStatusVerticalPodAutoscaler ¶
type TargetStatusVerticalPodAutoscaler struct { Name string `json:"name" protobuf:"bytes,1,name=name"` Role VerticalPodAutoscalerRole `json:"role" protobuf:"bytes,2,name=role"` }
func (*TargetStatusVerticalPodAutoscaler) DeepCopy ¶
func (in *TargetStatusVerticalPodAutoscaler) DeepCopy() *TargetStatusVerticalPodAutoscaler
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetStatusVerticalPodAutoscaler.
func (*TargetStatusVerticalPodAutoscaler) DeepCopyInto ¶
func (in *TargetStatusVerticalPodAutoscaler) DeepCopyInto(out *TargetStatusVerticalPodAutoscaler)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TargetsStatus ¶
type TargetsStatus struct { // +optional HorizontalPodAutoscaler string `json:"horizontalPodAutoscaler" protobuf:"bytes,1,opt,name=horizontalPodAutoscaler"` ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef" protobuf:"bytes,2,name=scaleTargetRef"` VerticalPodAutoscalers []TargetStatusVerticalPodAutoscaler `json:"verticalPodAutoscalers" protobuf:"bytes,3,name=verticalPodAutoscalers"` }
func (*TargetsStatus) DeepCopy ¶
func (in *TargetsStatus) DeepCopy() *TargetsStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetsStatus.
func (*TargetsStatus) DeepCopyInto ¶
func (in *TargetsStatus) DeepCopyInto(out *TargetsStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Tortoise ¶
type Tortoise struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec TortoiseSpec `json:"spec,omitempty"` Status TortoiseStatus `json:"status,omitempty"` }
Tortoise is the Schema for the tortoises API
func (*Tortoise) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tortoise.
func (*Tortoise) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Tortoise) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Tortoise) Default ¶
func (r *Tortoise) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (*Tortoise) SetupWebhookWithManager ¶
func (*Tortoise) ValidateCreate ¶
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*Tortoise) ValidateDelete ¶
ValidateDelete implements webhook.Validator so a webhook will be registered for the type TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
type TortoiseCondition ¶
type TortoiseCondition struct { // Type is the type of the condition. Type TortoiseConditionType `json:"type" protobuf:"bytes,1,name=type"` // Status is the status of the condition. (True, False, Unknown) Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,name=status"` // The last time this condition was updated. LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,6,opt,name=lastUpdateTime"` // lastTransitionTime is the last time the condition transitioned from // one status to another // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // reason is the reason for the condition's last transition. // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // message is a human-readable explanation containing details about // the transition // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` }
func (*TortoiseCondition) DeepCopy ¶
func (in *TortoiseCondition) DeepCopy() *TortoiseCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TortoiseCondition.
func (*TortoiseCondition) DeepCopyInto ¶
func (in *TortoiseCondition) DeepCopyInto(out *TortoiseCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TortoiseConditionType ¶
type TortoiseConditionType string
TortoiseConditionType are the valid conditions of a Tortoise.
const ( // TortoiseConditionTypeFailedToReconcile means tortoise failed to reconcile due to some reasons. TortoiseConditionTypeFailedToReconcile TortoiseConditionType = "FailedToReconcile" TortoiseConditionTypeHPATargetUtilizationUpdated TortoiseConditionType = "HPATargetUtilizationUpdated" )
type TortoiseList ¶
type TortoiseList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Tortoise `json:"items"` }
TortoiseList contains a list of Tortoise
func (*TortoiseList) DeepCopy ¶
func (in *TortoiseList) DeepCopy() *TortoiseList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TortoiseList.
func (*TortoiseList) DeepCopyInto ¶
func (in *TortoiseList) DeepCopyInto(out *TortoiseList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TortoiseList) DeepCopyObject ¶
func (in *TortoiseList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type TortoisePhase ¶
type TortoisePhase string
const ( // TortoisePhaseInitializing means tortoise is just created and initializing some components (HPA and VPAs), // and wait for those components to be ready. TortoisePhaseInitializing TortoisePhase = "Initializing" // TortoisePhaseGatheringData means tortoise is now gathering data and cannot make the accurate recommendations. TortoisePhaseGatheringData TortoisePhase = "GatheringData" // TortoisePhaseWorking means tortoise is making the recommendations, // and applying the recommendation values. TortoisePhaseWorking TortoisePhase = "Working" // TortoisePhasePartlyWorking means tortoise has maxReplicas and minReplicas recommendations ready, // and applying the recommendation values. // But, some of the resources are not scaled due to some reasons. (probably still gathering data) TortoisePhasePartlyWorking TortoisePhase = "PartlyWorking" // TortoisePhaseEmergency means tortoise is in the emergency mode. TortoisePhaseEmergency TortoisePhase = "Emergency" // TortoisePhaseBackToNormal means tortoise was in the emergency mode, and now it's coming back to the normal operation. // During TortoisePhaseBackToNormal, the number of replicas of workloads are gradually reduced to the usual value. TortoisePhaseBackToNormal TortoisePhase = "BackToNormal" )
type TortoiseSpec ¶
type TortoiseSpec struct { // TargetRefs has reference to involved resources. TargetRefs TargetRefs `json:"targetRefs" protobuf:"bytes,1,name=targetRefs"` // UpdateMode is how tortoise update resources. // If "Off", tortoise generates the recommendations in .Status, but doesn't apply it actually. // If "Auto", tortoise generates the recommendations in .Status, and apply it to resources. // If "Emergency", tortoise generates the recommendations in .Status as usual, but increase replica number high enough value. // "Emergency" is useful when something unexpected happens in workloads, and you want to scale up the workload with high enough resources. // See https://github.com/mercari/tortoise/blob/main/docs/emergency.md to know more about emergency mode. // // "Off" is the default value. // +optional UpdateMode UpdateMode `json:"updateMode,omitempty" protobuf:"bytes,2,opt,name=updateMode"` // ResourcePolicy contains the policy how each resource is updated. // +optional ResourcePolicy []ContainerResourcePolicy `json:"resourcePolicy,omitempty" protobuf:"bytes,3,opt,name=resourcePolicy"` // DeletionPolicy is the policy how the controller deletes associated HPA and VPAs when tortoise is removed. // If "DeleteAll", tortoise deletes all associated HPA and VPAs, created by tortoise. If the associated HPA is not created by tortoise, // which is associated by spec.targetRefs.horizontalPodAutoscalerName, tortoise never delete the HPA. // If "NoDelete", tortoise doesn't delete any associated HPA and VPAs. // // "NoDelete" is the default value. // +optional DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty" protobuf:"bytes,4,opt,name=deletionPolicy"` // AutoscalingPolicy is an optional field for specifying the scaling approach for each resource within each container. // // There are two primary options for configuring resource scaling within containers: // 1. Allow Tortoise to automatically determine the appropriate autoscaling policy for each resource. // 2. Manually define the autoscaling policy for each resource. // // For the first option, simply leave this field unset. In this case, Tortoise will adjust the autoscaling policies using the following logic: // - If .spec.TargetRefs.HorizontalPodAutoscalerName is not provided, the policies default to "Horizontal" for CPU and "Vertical" for memory across all containers. // - If .spec.TargetRefs.HorizontalPodAutoscalerName is specified, resources governed by the referenced Horizontal Pod Autoscaler will use a "Horizontal" policy, // while those not managed by the HPA will use a "Vertical" policy. // Note that Tortoise supports only the ContainerResource metric type for HPAs; other metric types will be disregarded. // Additionally, if a ContainerResource metric is later added to an HPA associated with Tortoise, // Tortoise will automatically update relevant resources to utilize a "Horizontal" policy. // // With the second option, you must manually specify the AutoscalingPolicy for the resources of each container within this field. // If policies are defined for some but not all containers or resources, Tortoise will assign a default "Off" policy to unspecified resources. // Be aware that when new containers are introduced to the workload, the AutoscalingPolicy configuration must be manually updated, // as Tortoise will default to an "Off" policy for resources within the new container, preventing scaling. // // The AutoscalingPolicy field is mutable; you can modify it at any time, whether from an empty state to populated or vice versa. // +optional AutoscalingPolicy []ContainerAutoscalingPolicy `json:"autoscalingPolicy,omitempty" protobuf:"bytes,5,opt,name=autoscalingPolicy"` }
TortoiseSpec defines the desired state of Tortoise
func (*TortoiseSpec) DeepCopy ¶
func (in *TortoiseSpec) DeepCopy() *TortoiseSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TortoiseSpec.
func (*TortoiseSpec) DeepCopyInto ¶
func (in *TortoiseSpec) DeepCopyInto(out *TortoiseSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TortoiseStatus ¶
type TortoiseStatus struct { TortoisePhase TortoisePhase `json:"tortoisePhase" protobuf:"bytes,1,name=tortoisePhase"` Conditions Conditions `json:"conditions" protobuf:"bytes,2,name=conditions"` Recommendations Recommendations `json:"recommendations" protobuf:"bytes,3,name=recommendations"` Targets TargetsStatus `json:"targets" protobuf:"bytes,4,name=targets"` ContainerResourcePhases []ContainerResourcePhases `json:"containerResourcePhases" protobuf:"bytes,5,name=containerResourcePhases"` // AutoscalingPolicy contains the policy how this tortoise actually scales each resource. // It should basically be the same as .spec.autoscalingPolicy. // But, if .spec.autoscalingPolicy is empty, tortoise manages/generates // the policies generated based on HPA and the target deployment. AutoscalingPolicy []ContainerAutoscalingPolicy `json:"autoscalingPolicy,omitempty" protobuf:"bytes,6,opt,name=autoscalingPolicy"` }
TortoiseStatus defines the observed state of Tortoise
func (*TortoiseStatus) DeepCopy ¶
func (in *TortoiseStatus) DeepCopy() *TortoiseStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TortoiseStatus.
func (*TortoiseStatus) DeepCopyInto ¶
func (in *TortoiseStatus) DeepCopyInto(out *TortoiseStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UpdateMode ¶
type UpdateMode string
+kubebuilder:validation:Enum=Off;Auto;Emergency
const ( UpdateModeOff UpdateMode = "Off" UpdateModeEmergency UpdateMode = "Emergency" UpdateModeAuto UpdateMode = "Auto" )
type VerticalPodAutoscalerRole ¶
type VerticalPodAutoscalerRole string
+kubebuilder:validation:Enum=Updater;Monitor
type VerticalRecommendations ¶
type VerticalRecommendations struct { // +optional ContainerResourceRecommendation []RecommendedContainerResources `json:"containerResourceRecommendation" protobuf:"bytes,1,name=containerResourceRecommendation"` }
func (*VerticalRecommendations) DeepCopy ¶
func (in *VerticalRecommendations) DeepCopy() *VerticalRecommendations
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VerticalRecommendations.
func (*VerticalRecommendations) DeepCopyInto ¶
func (in *VerticalRecommendations) DeepCopyInto(out *VerticalRecommendations)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.