Documentation
¶
Overview ¶
Package v1alpha1 contains v1alpha1 version's types in autoscaling.nebula-graph.io group.
+groupName=autoscaling.nebula-graph.io +k8s:defaulter-gen=TypeMeta +k8s:defaulter-gen-input=github.com/vesoft-inc/nebula-operator/apis/autoscaling/v1alpha1
Package v1alpha1 contains API Schema definitions for the autoscaling v1alpha1 API group +kubebuilder:object:generate=true +groupName=autoscaling.nebula-graph.io
Index ¶
- Constants
- Variables
- func GenerateHPAScaleDownRules(scalingRules *autoscalingv2.HPAScalingRules) *autoscalingv2.HPAScalingRules
- func GenerateHPAScaleUpRules(scalingRules *autoscalingv2.HPAScalingRules) *autoscalingv2.HPAScalingRules
- func RegisterDefaults(scheme *runtime.Scheme) error
- func Resource(resource string) schema.GroupResource
- func SetDefaults_NebulaAutoscaler(obj *NebulaAutoscaler)
- func SetDefaults_NebulaAutoscalerBehavior(obj *NebulaAutoscaler)
- func SetObjectDefaults_NebulaAutoscaler(in *NebulaAutoscaler)
- func SetObjectDefaults_NebulaAutoscalerList(in *NebulaAutoscalerList)
- type AutoscalingPolicySpec
- type AutoscalingPolicyStatus
- type NebulaAutoscaler
- type NebulaAutoscalerCondition
- type NebulaAutoscalerConditionType
- type NebulaAutoscalerList
- type NebulaAutoscalerSpec
- type NebulaAutoscalerStatus
- type NebulaClusterRef
Constants ¶
const DefaultCPUUtilization = 80
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "autoscaling.nebula-graph.io", Version: "v1alpha1"} SchemeGroupVersion = GroupVersion // 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 ( // DefaultPollingPeriod is the default period between 2 autoscaling API polls. DefaultPollingPeriod = 30 * time.Second )
Functions ¶
func GenerateHPAScaleDownRules ¶
func GenerateHPAScaleDownRules(scalingRules *autoscalingv2.HPAScalingRules) *autoscalingv2.HPAScalingRules
GenerateHPAScaleDownRules returns a fully-initialized HPAScalingRules value We guarantee that no pointer in the structure will have the 'nil' value EXCEPT StabilizationWindowSeconds, for reasoning check the comment for defaultHPAScaleDownRules
func GenerateHPAScaleUpRules ¶
func GenerateHPAScaleUpRules(scalingRules *autoscalingv2.HPAScalingRules) *autoscalingv2.HPAScalingRules
GenerateHPAScaleUpRules returns a fully-initialized HPAScalingRules value We guarantee that no pointer in the structure will have the 'nil' value
func RegisterDefaults ¶
RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource is required by pkg/client/listers/...
func SetDefaults_NebulaAutoscaler ¶
func SetDefaults_NebulaAutoscaler(obj *NebulaAutoscaler)
func SetDefaults_NebulaAutoscalerBehavior ¶
func SetDefaults_NebulaAutoscalerBehavior(obj *NebulaAutoscaler)
SetDefaults_NebulaAutoscalerBehavior fills the behavior if it is not null
func SetObjectDefaults_NebulaAutoscaler ¶
func SetObjectDefaults_NebulaAutoscaler(in *NebulaAutoscaler)
func SetObjectDefaults_NebulaAutoscalerList ¶
func SetObjectDefaults_NebulaAutoscalerList(in *NebulaAutoscalerList)
Types ¶
type AutoscalingPolicySpec ¶
type AutoscalingPolicySpec struct { // MinReplicas is the lower limit for the number of replicas to which the autoscaler // can scale down. // +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). // 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"` }
func (*AutoscalingPolicySpec) DeepCopy ¶
func (in *AutoscalingPolicySpec) DeepCopy() *AutoscalingPolicySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalingPolicySpec.
func (*AutoscalingPolicySpec) DeepCopyInto ¶
func (in *AutoscalingPolicySpec) DeepCopyInto(out *AutoscalingPolicySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AutoscalingPolicyStatus ¶
type AutoscalingPolicyStatus struct { // LastScaleTime is the last time the autoscaler scaled the number of pods, // used by the autoscaler to control how often the number of pods is changed. // +optional LastScaleTime *metav1.Time `json:"lastScaleTime,omitempty"` // CurrentReplicas is current number of replicas of pods managed by this autoscaler, // as last seen by the autoscaler. // +optional CurrentReplicas int32 `json:"currentReplicas,omitempty"` // DesiredReplicas is the desired number of replicas of pods managed by this autoscaler, // as last calculated by the autoscaler. DesiredReplicas int32 `json:"desiredReplicas"` // CurrentMetrics is the last read state of the metrics used by this autoscaler. // +optional CurrentMetrics []autoscalingv2.MetricStatus `json:"currentMetrics"` }
func (*AutoscalingPolicyStatus) DeepCopy ¶
func (in *AutoscalingPolicyStatus) DeepCopy() *AutoscalingPolicyStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalingPolicyStatus.
func (*AutoscalingPolicyStatus) DeepCopyInto ¶
func (in *AutoscalingPolicyStatus) DeepCopyInto(out *AutoscalingPolicyStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NebulaAutoscaler ¶
type NebulaAutoscaler struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec NebulaAutoscalerSpec `json:"spec,omitempty"` Status NebulaAutoscalerStatus `json:"status,omitempty"` }
NebulaAutoscaler represents an NebulaAutoscaler resource in a Kubernetes cluster
func (*NebulaAutoscaler) DeepCopy ¶
func (in *NebulaAutoscaler) DeepCopy() *NebulaAutoscaler
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NebulaAutoscaler.
func (*NebulaAutoscaler) DeepCopyInto ¶
func (in *NebulaAutoscaler) DeepCopyInto(out *NebulaAutoscaler)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*NebulaAutoscaler) DeepCopyObject ¶
func (in *NebulaAutoscaler) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*NebulaAutoscaler) GetPollingPeriod ¶
func (na *NebulaAutoscaler) GetPollingPeriod() *metav1.Duration
type NebulaAutoscalerCondition ¶
type NebulaAutoscalerCondition struct { // Type describes the current condition Type NebulaAutoscalerConditionType `json:"type"` // Status is the status of the condition (True, False, Unknown) Status corev1.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"` }
func (*NebulaAutoscalerCondition) DeepCopy ¶
func (in *NebulaAutoscalerCondition) DeepCopy() *NebulaAutoscalerCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NebulaAutoscalerCondition.
func (*NebulaAutoscalerCondition) DeepCopyInto ¶
func (in *NebulaAutoscalerCondition) DeepCopyInto(out *NebulaAutoscalerCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NebulaAutoscalerConditionType ¶
type NebulaAutoscalerConditionType string
const ( // AutoscalerActive indicates that the HPA controller is able to scale if necessary: // it's correctly configured, can fetch the desired metrics, and isn't disabled. AutoscalerActive NebulaAutoscalerConditionType = "Active" // AbleToScale indicates a lack of transient issues which prevent scaling from occurring, // such as being in a backoff window, or being unable to access/update the target scale. AbleToScale NebulaAutoscalerConditionType = "AbleToScale" // AutoscalerLimited indicates that the calculated scale based on metrics would be above or // below the range for the HPA, and has thus been capped. AutoscalerLimited NebulaAutoscalerConditionType = "Limited" // AutoscalerReady indicates that the nebula cluster is ready. AutoscalerReady NebulaAutoscalerConditionType = "Ready" )
type NebulaAutoscalerList ¶
type NebulaAutoscalerList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []NebulaAutoscaler `json:"items"` }
NebulaAutoscalerList contains a list of NebulaAutoscaler
func (*NebulaAutoscalerList) DeepCopy ¶
func (in *NebulaAutoscalerList) DeepCopy() *NebulaAutoscalerList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NebulaAutoscalerList.
func (*NebulaAutoscalerList) DeepCopyInto ¶
func (in *NebulaAutoscalerList) DeepCopyInto(out *NebulaAutoscalerList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*NebulaAutoscalerList) DeepCopyObject ¶
func (in *NebulaAutoscalerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type NebulaAutoscalerSpec ¶
type NebulaAutoscalerSpec struct { // +kubebuilder:validation:Required NebulaClusterRef NebulaClusterRef `json:"nebulaClusterRef"` GraphdPolicy AutoscalingPolicySpec `json:"graphdPolicy"` // +optional // PollingPeriod is the period at which to synchronize with the autoscaling API. PollingPeriod *metav1.Duration `json:"pollingPeriod,omitempty"` }
NebulaAutoscalerSpec defines the desired state of NebulaAutoscaler
func (*NebulaAutoscalerSpec) DeepCopy ¶
func (in *NebulaAutoscalerSpec) DeepCopy() *NebulaAutoscalerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NebulaAutoscalerSpec.
func (*NebulaAutoscalerSpec) DeepCopyInto ¶
func (in *NebulaAutoscalerSpec) DeepCopyInto(out *NebulaAutoscalerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NebulaAutoscalerStatus ¶
type NebulaAutoscalerStatus struct { // ObservedGeneration is the most recent generation observed by this autoscaler. // +optional ObservedGeneration *int64 `json:"observedGeneration,omitempty"` // GraphdStatuses describes the status of Graphd autoscaling policies. // +optional GraphdStatus AutoscalingPolicyStatus `json:"graphdStatus,omitempty"` // Conditions is the set of conditions required for this autoscaler to scale its target, // and indicates whether those conditions are met. // +optional Conditions []NebulaAutoscalerCondition `json:"conditions,omitempty"` }
NebulaAutoscalerStatus defines the observed state of NebulaAutoscaler
func (*NebulaAutoscalerStatus) DeepCopy ¶
func (in *NebulaAutoscalerStatus) DeepCopy() *NebulaAutoscalerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NebulaAutoscalerStatus.
func (*NebulaAutoscalerStatus) DeepCopyInto ¶
func (in *NebulaAutoscalerStatus) DeepCopyInto(out *NebulaAutoscalerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NebulaClusterRef ¶
type NebulaClusterRef struct { // Name is the name of the NebulaCluster resource to scale automatically. // +kubebuilder:validation:MinLength=1 Name string `json:"name"` }
func (*NebulaClusterRef) DeepCopy ¶
func (in *NebulaClusterRef) DeepCopy() *NebulaClusterRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NebulaClusterRef.
func (*NebulaClusterRef) DeepCopyInto ¶
func (in *NebulaClusterRef) DeepCopyInto(out *NebulaClusterRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.