Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the autoscale v1alpha1 API group +kubebuilder:object:generate=true +groupName=autoscale.scale.shikanon.com
Index ¶
- Variables
- type RecommendationScaleFactor
- type RecommendationScaleFactorCondition
- type RecommendationScaleFactorConditionType
- type RecommendationScaleFactorList
- type RecommendationScaleFactorSpec
- type RecommendationScaleFactorStatus
- type ResourceScaleFactor
- type ResourceStautsField
- type ScalePolicyResourceType
- type ScaleResourcePolicy
- type ScaleTargetResourceReference
- type ScaleUpdateParameter
- type SimpleAutoScaler
- type SimpleAutoScalerCondition
- type SimpleAutoScalerConditionType
- type SimpleAutoScalerList
- type SimpleAutoScalerResources
- type SimpleAutoScalerSpec
- type SimpleAutoScalerStatus
- func (s *SimpleAutoScalerStatus) AddCondition(condtype SimpleAutoScalerConditionType, err error)
- func (s *SimpleAutoScalerStatus) AppendConditions(cond SimpleAutoScalerCondition)
- func (in *SimpleAutoScalerStatus) DeepCopy() *SimpleAutoScalerStatus
- func (in *SimpleAutoScalerStatus) DeepCopyInto(out *SimpleAutoScalerStatus)
- func (s *SimpleAutoScalerStatus) GetConditionsStatus(cond SimpleAutoScalerConditionType) string
- type UpdateMode
Constants ¶
This section is empty.
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "autoscale.scale.shikanon.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 RecommendationScaleFactor ¶
type RecommendationScaleFactor struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec RecommendationScaleFactorSpec `json:"spec,omitempty"`
Status RecommendationScaleFactorStatus `json:"status,omitempty"`
}
RecommendationScaleFactor is the Schema for the recommendationscalefactors API
func (*RecommendationScaleFactor) DeepCopy ¶
func (in *RecommendationScaleFactor) DeepCopy() *RecommendationScaleFactor
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendationScaleFactor.
func (*RecommendationScaleFactor) DeepCopyInto ¶
func (in *RecommendationScaleFactor) DeepCopyInto(out *RecommendationScaleFactor)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RecommendationScaleFactor) DeepCopyObject ¶
func (in *RecommendationScaleFactor) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RecommendationScaleFactorCondition ¶
type RecommendationScaleFactorCondition struct {
// condition type
Type RecommendationScaleFactorConditionType `json:"type"`
// condition status
Status corev1.ConditionStatus `json:"status"`
// LastTransitionTime is the last time the condition transitioned from on one status to another
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
// message is a human-readable explaination containing details
Message string `json:"message,omitempty"`
}
func (*RecommendationScaleFactorCondition) DeepCopy ¶
func (in *RecommendationScaleFactorCondition) DeepCopy() *RecommendationScaleFactorCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendationScaleFactorCondition.
func (*RecommendationScaleFactorCondition) DeepCopyInto ¶
func (in *RecommendationScaleFactorCondition) DeepCopyInto(out *RecommendationScaleFactorCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RecommendationScaleFactorConditionType ¶
type RecommendationScaleFactorConditionType string
const ( QueryExistCondition RecommendationScaleFactorConditionType = "QueryExist" ValidRecommendValueCondition RecommendationScaleFactorConditionType = "ValidRecommendValue" RecommendationCoolDownCondition RecommendationScaleFactorConditionType = "Cooldown" )
type RecommendationScaleFactorList ¶
type RecommendationScaleFactorList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []RecommendationScaleFactor `json:"items"`
}
RecommendationScaleFactorList contains a list of RecommendationScaleFactor
func (*RecommendationScaleFactorList) DeepCopy ¶
func (in *RecommendationScaleFactorList) DeepCopy() *RecommendationScaleFactorList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendationScaleFactorList.
func (*RecommendationScaleFactorList) DeepCopyInto ¶
func (in *RecommendationScaleFactorList) DeepCopyInto(out *RecommendationScaleFactorList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RecommendationScaleFactorList) DeepCopyObject ¶
func (in *RecommendationScaleFactorList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RecommendationScaleFactorSpec ¶
type RecommendationScaleFactorSpec struct {
// Reference of resources
Ref *autoscalingv1.CrossVersionObjectReference `json:"ref,omitempty"`
// expression of query
Query string `json:"query,omitempty"`
// desiredValue
DesiredValue string `json:"desiredValue,omitempty"`
// cooldown is the time of calcution, only affect statusFactor update and not affect the currentValue update
Cooldown string `json:"cooldown,omitempty"`
// minScope is the percentage of desireValue range
MinScope int `json:"minScope,omitempty"`
}
RecommendationScaleFactorSpec defines the desired state of RecommendationScaleFactor
func (*RecommendationScaleFactorSpec) DeepCopy ¶
func (in *RecommendationScaleFactorSpec) DeepCopy() *RecommendationScaleFactorSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendationScaleFactorSpec.
func (*RecommendationScaleFactorSpec) DeepCopyInto ¶
func (in *RecommendationScaleFactorSpec) DeepCopyInto(out *RecommendationScaleFactorSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RecommendationScaleFactorStatus ¶
type RecommendationScaleFactorStatus struct {
// result of query current value
CurrentValue string `json:"currentValue,omitempty"`
// Calculated by currentvalue and desiredvalue
ScaleFactor string `json:"scaleFactor,omitempty"`
// Conditions is set of conditions required for the recommendation scale
Conditions []RecommendationScaleFactorCondition `json:"conditions,omitempty"`
// last cooldown time
LastCoolDownTime metav1.Time `json:"lastCoolDownTime,omitempty"`
}
RecommendationScaleFactorStatus defines the observed state of RecommendationScaleFactor
func (*RecommendationScaleFactorStatus) AppendConditions ¶
func (s *RecommendationScaleFactorStatus) AppendConditions(cond RecommendationScaleFactorCondition)
special function
func (*RecommendationScaleFactorStatus) DeepCopy ¶
func (in *RecommendationScaleFactorStatus) DeepCopy() *RecommendationScaleFactorStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecommendationScaleFactorStatus.
func (*RecommendationScaleFactorStatus) DeepCopyInto ¶
func (in *RecommendationScaleFactorStatus) DeepCopyInto(out *RecommendationScaleFactorStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceScaleFactor ¶
type ResourceScaleFactor struct {
// Kind of the reference resource
Kind string `json:"kind"`
// API version of the reference resource
APIVersion string `json:"apiVersion,omitempty"`
// Name of the referent
Name string `json:"name,omitempty"`
// Namespace
Namespace string `json:"namespace,omitempty"`
// the field of target resource will be updated
Field string `json:"field,omitempty"`
}
func (*ResourceScaleFactor) DeepCopy ¶
func (in *ResourceScaleFactor) DeepCopy() *ResourceScaleFactor
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceScaleFactor.
func (*ResourceScaleFactor) DeepCopyInto ¶
func (in *ResourceScaleFactor) DeepCopyInto(out *ResourceScaleFactor)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceStautsField ¶
type ResourceStautsField struct {
// name of field, be consistent in spec field
Name string `json:"name,omitempty"`
// path of fields
Path string `json:"path,omitempty"`
// from ScaleFactorObject read the value
ScaleFactor string `json:"scaleFactor,omitempty"`
// current value of field
CurrentFieldValue resource.Quantity `json:"currentFieldValue,omitempty"`
// desire value of field
DesiredFieldValue resource.Quantity `json:"desiredFieldValue,omitempty"`
// last time of upscale
LastUpScaleTime metav1.Time `json:"lastUpScaleTime,omitempty"`
// last time of downscale
LastDownScaleTime metav1.Time `json:"lastDownScaleTime,omitempty"`
}
func (*ResourceStautsField) DeepCopy ¶
func (in *ResourceStautsField) DeepCopy() *ResourceStautsField
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceStautsField.
func (*ResourceStautsField) DeepCopyInto ¶
func (in *ResourceStautsField) DeepCopyInto(out *ResourceStautsField)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScalePolicyResourceType ¶
type ScalePolicyResourceType string
const ( // cpu resource CPUResourceType ScalePolicyResourceType = "cpu" // memory resource MemoryResourceType ScalePolicyResourceType = "memory" // replicas resource ReplicasResourceType ScalePolicyResourceType = "replicas" // other extend resource, like gpu OtherResourceType ScalePolicyResourceType = "other" )
type ScaleResourcePolicy ¶
type ScaleResourcePolicy struct {
// the name of scalePolicy
Name string `json:"name"`
// the field of target resource will be updated
Field string `json:"field"`
// field type
FieldType ScalePolicyResourceType `json:"type,omitempty"`
// Update is parameter of update
Update *ScaleUpdateParameter `json:"update,omitempty"`
// description of the scale factor resource
ScaleFactorObject *ResourceScaleFactor `json:"scaleFactorObject,omitempty"`
}
func (*ScaleResourcePolicy) DeepCopy ¶
func (in *ScaleResourcePolicy) DeepCopy() *ScaleResourcePolicy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleResourcePolicy.
func (*ScaleResourcePolicy) DeepCopyInto ¶
func (in *ScaleResourcePolicy) DeepCopyInto(out *ScaleResourcePolicy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScaleTargetResourceReference ¶
type ScaleTargetResourceReference struct {
// Kind of the reference resource
Kind string `json:"kind"`
// API version of the reference resource
APIVersion string `json:"apiVersion,omitempty"`
// Name of the referent
Name string `json:"name,omitempty"`
// Selector of match label
Selector map[string]string `json:"selector,omitempty"`
}
func (*ScaleTargetResourceReference) DeepCopy ¶
func (in *ScaleTargetResourceReference) DeepCopy() *ScaleTargetResourceReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleTargetResourceReference.
func (*ScaleTargetResourceReference) DeepCopyInto ¶
func (in *ScaleTargetResourceReference) DeepCopyInto(out *ScaleTargetResourceReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ScaleUpdateParameter ¶
type ScaleUpdateParameter struct {
// the time interval of between downscale
DownscaleWindow string `json:"downscaleWindow,omitempty"`
// the time interval of between upscale
UpscaleWindow string `json:"upscaleWindow,omitempty"`
// the field range of minimum bound
MinAllowed resource.Quantity `json:"minAllowed,omitempty"`
// the field range of maximum bound
MaxAllowed resource.Quantity `json:"maxAllowed,omitempty"`
// update action mode
Mode UpdateMode `json:"mode,omitempty"`
}
func (*ScaleUpdateParameter) DeepCopy ¶
func (in *ScaleUpdateParameter) DeepCopy() *ScaleUpdateParameter
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleUpdateParameter.
func (*ScaleUpdateParameter) DeepCopyInto ¶
func (in *ScaleUpdateParameter) DeepCopyInto(out *ScaleUpdateParameter)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SimpleAutoScaler ¶
type SimpleAutoScaler struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec SimpleAutoScalerSpec `json:"spec,omitempty"`
Status SimpleAutoScalerStatus `json:"status,omitempty"`
}
SimpleAutoScaler is the Schema for the simpleautoscalers API
func (*SimpleAutoScaler) DeepCopy ¶
func (in *SimpleAutoScaler) DeepCopy() *SimpleAutoScaler
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleAutoScaler.
func (*SimpleAutoScaler) DeepCopyInto ¶
func (in *SimpleAutoScaler) DeepCopyInto(out *SimpleAutoScaler)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SimpleAutoScaler) DeepCopyObject ¶
func (in *SimpleAutoScaler) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SimpleAutoScalerCondition ¶
type SimpleAutoScalerCondition struct {
// condition type
Type SimpleAutoScalerConditionType `json:"type"`
// condition status
Status corev1.ConditionStatus `json:"status"`
// LastTransitionTime is the last time the condition transitioned from on one status to another
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
// message is a human-readable explaination containing details
Message string `json:"message,omitempty"`
}
func (*SimpleAutoScalerCondition) DeepCopy ¶
func (in *SimpleAutoScalerCondition) DeepCopy() *SimpleAutoScalerCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleAutoScalerCondition.
func (*SimpleAutoScalerCondition) DeepCopyInto ¶
func (in *SimpleAutoScalerCondition) DeepCopyInto(out *SimpleAutoScalerCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SimpleAutoScalerConditionType ¶
type SimpleAutoScalerConditionType string
const ( // scaler match all resource and write it in status.resources MatchedAllResourceCondition SimpleAutoScalerConditionType = "MatchedAllResource" // checking policy filed and write it into currentFieldValue CheckPolicyFieldValueCondition SimpleAutoScalerConditionType = "CheckPolicyFieldValue" // checking policy scaleFactorObject and read the object values and write into scaleFactor GetScaleFactorCondition SimpleAutoScalerConditionType = "GetScaleFactor" // checking the desiredFieldValue whether in minAllowd and maxAllowd and write into status UpdatedFieldCondition SimpleAutoScalerConditionType = "UpdatedFieldCondition" // the scale whether can update the object compare the downscaleWindow and upscaleWindow, if okay // set lastUpScaleTime and lastDownScaleTime EndCooldownCondition SimpleAutoScalerConditionType = "EndCooldown" // when all ready it will update the target resource UpdateTargetResourceCondition SimpleAutoScalerConditionType = "UpdateTargetResource" )
type SimpleAutoScalerList ¶
type SimpleAutoScalerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []SimpleAutoScaler `json:"items"`
}
SimpleAutoScalerList contains a list of SimpleAutoScaler
func (*SimpleAutoScalerList) DeepCopy ¶
func (in *SimpleAutoScalerList) DeepCopy() *SimpleAutoScalerList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleAutoScalerList.
func (*SimpleAutoScalerList) DeepCopyInto ¶
func (in *SimpleAutoScalerList) DeepCopyInto(out *SimpleAutoScalerList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SimpleAutoScalerList) DeepCopyObject ¶
func (in *SimpleAutoScalerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SimpleAutoScalerResources ¶
type SimpleAutoScalerResources struct {
// Target points to the scale controls resources
Target *autoscalingv1.CrossVersionObjectReference `json:"target,omitempty"`
// record information of scale target
ResourceFields []ResourceStautsField `json:"resourceFields,omitempty"`
}
func (*SimpleAutoScalerResources) DeepCopy ¶
func (in *SimpleAutoScalerResources) DeepCopy() *SimpleAutoScalerResources
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleAutoScalerResources.
func (*SimpleAutoScalerResources) DeepCopyInto ¶
func (in *SimpleAutoScalerResources) DeepCopyInto(out *SimpleAutoScalerResources)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SimpleAutoScalerSpec ¶
type SimpleAutoScalerSpec struct {
// TargetRef is container scale resources
TargetRef *ScaleTargetResourceReference `json:"targetRef"`
// Policy is description rules to the relate parameter and update field
Policy []ScaleResourcePolicy `json:"policy,omitempty"`
}
SimpleAutoScalerSpec defines the desired state of SimpleAutoScaler
func (*SimpleAutoScalerSpec) DeepCopy ¶
func (in *SimpleAutoScalerSpec) DeepCopy() *SimpleAutoScalerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleAutoScalerSpec.
func (*SimpleAutoScalerSpec) DeepCopyInto ¶
func (in *SimpleAutoScalerSpec) DeepCopyInto(out *SimpleAutoScalerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SimpleAutoScalerStatus ¶
type SimpleAutoScalerStatus struct {
// Conditions is set of conditions required for autoscaler to scale target
Conditions []SimpleAutoScalerCondition `json:"conditions"`
// Resources which scaler select
Resources []SimpleAutoScalerResources `json:"resources"`
}
SimpleAutoScalerStatus defines the observed state of SimpleAutoScaler
func (*SimpleAutoScalerStatus) AddCondition ¶
func (s *SimpleAutoScalerStatus) AddCondition(condtype SimpleAutoScalerConditionType, err error)
func (*SimpleAutoScalerStatus) AppendConditions ¶
func (s *SimpleAutoScalerStatus) AppendConditions(cond SimpleAutoScalerCondition)
special function
func (*SimpleAutoScalerStatus) DeepCopy ¶
func (in *SimpleAutoScalerStatus) DeepCopy() *SimpleAutoScalerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleAutoScalerStatus.
func (*SimpleAutoScalerStatus) DeepCopyInto ¶
func (in *SimpleAutoScalerStatus) DeepCopyInto(out *SimpleAutoScalerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SimpleAutoScalerStatus) GetConditionsStatus ¶
func (s *SimpleAutoScalerStatus) GetConditionsStatus(cond SimpleAutoScalerConditionType) string
four condition status, true, false, unknow and nil string
type UpdateMode ¶
type UpdateMode string
UpdateMode controls whether can upscale or downscale
const ( // default is update can upscale and downsale UpdateModeDefault UpdateMode = "default" // onlyUpScale is update only for upscale UpdateModeOnlyUpscale UpdateMode = "onlyUpScale" // onlyDownScale is update only for upscale UpdateModeOnlyDownscale UpdateMode = "onlyDownScale" )