v1alpha1

package
v4.2.546+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 5

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the autoscaling v1alpha1 API group +kubebuilder:object:generate=true +groupName=autoscaling.containers.ai

Index

Constants

View Source
const (
	RecommendationPolicySTABLE  alamedaPolicy = "stable"
	RecommendationPolicyCOMPACT alamedaPolicy = "compact"
)
View Source
const (
	DefaultTriggerThresholdCPUPercentage    = "10%"
	DefaultTriggerThresholdMemoryPercentage = "10%"
)
View Source
const (
	DefaultMaxUnavailablePercentage = "25%"
)

Variables

View Source
var (
	AlamedaControllerTypeName = map[AlamedaControllerType]string{
		DeploymentController:       "deployment",
		DeploymentConfigController: "deploymentconfig",
		StatefulSetController:      "statefulset",
	}

	K8SKindToAlamedaControllerType = map[string]AlamedaControllerType{
		"Deployment":       DeploymentController,
		"DeploymentConfig": DeploymentConfigController,
		"StatefulSet":      StatefulSetController,
	}
)
View Source
var (

	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "autoscaling.containers.ai", 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 AlamedaContainer

type AlamedaContainer struct {
	Name      string                      `json:"name" protobuf:"bytes,1,opt,name=name"`
	Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,2,opt,name=resources"`
}

func (*AlamedaContainer) DeepCopy

func (in *AlamedaContainer) DeepCopy() *AlamedaContainer

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

func (*AlamedaContainer) DeepCopyInto

func (in *AlamedaContainer) DeepCopyInto(out *AlamedaContainer)

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

type AlamedaController

type AlamedaController struct {
	Deployments       map[NamespacedName]AlamedaResource `json:"deployments,omitempty" protobuf:"bytes,1,opt,name=deployments"`
	DeploymentConfigs map[NamespacedName]AlamedaResource `json:"deploymentConfigs,omitempty" protobuf:"bytes,2,opt,name=deployment_configs"`
	StatefulSets      map[NamespacedName]AlamedaResource `json:"statefulSets,omitempty" protobuf:"bytes,3,opt,name=stateful_sets"`
}

func (*AlamedaController) DeepCopy

func (in *AlamedaController) DeepCopy() *AlamedaController

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

func (*AlamedaController) DeepCopyInto

func (in *AlamedaController) DeepCopyInto(out *AlamedaController)

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

type AlamedaControllerType

type AlamedaControllerType int
const (
	DeploymentController       AlamedaControllerType = 1
	DeploymentConfigController AlamedaControllerType = 2
	StatefulSetController      AlamedaControllerType = 3
)

type AlamedaPod

type AlamedaPod struct {
	Namespace  string             `json:"namespace" protobuf:"bytes,1,opt,name=namespace"`
	Name       string             `json:"name" protobuf:"bytes,2,opt,name=name"`
	UID        string             `json:"uid" protobuf:"bytes,3,opt,name=uid"`
	Containers []AlamedaContainer `json:"containers" protobuf:"bytes,4,opt,name=containers"`
}

func (*AlamedaPod) DeepCopy

func (in *AlamedaPod) DeepCopy() *AlamedaPod

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

func (*AlamedaPod) DeepCopyInto

func (in *AlamedaPod) DeepCopyInto(out *AlamedaPod)

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

func (*AlamedaPod) GetNamespacedName

func (p *AlamedaPod) GetNamespacedName() NamespacedName

type AlamedaRecommendation

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

	Spec   AlamedaRecommendationSpec   `json:"spec,omitempty"`
	Status AlamedaRecommendationStatus `json:"status,omitempty"`
}

AlamedaRecommendation is the Schema for the alamedarecommendations API +k8s:openapi-gen=true

func (*AlamedaRecommendation) DeepCopy

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

func (*AlamedaRecommendation) DeepCopyInto

func (in *AlamedaRecommendation) DeepCopyInto(out *AlamedaRecommendation)

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

func (*AlamedaRecommendation) DeepCopyObject

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

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

func (*AlamedaRecommendation) GetNamespacedName

func (ar *AlamedaRecommendation) GetNamespacedName() NamespacedName

type AlamedaRecommendationList

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

AlamedaRecommendationList contains a list of AlamedaRecommendation

func (*AlamedaRecommendationList) DeepCopy

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

func (*AlamedaRecommendationList) DeepCopyInto

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

func (*AlamedaRecommendationList) DeepCopyObject

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

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

type AlamedaRecommendationSpec

type AlamedaRecommendationSpec struct {
	Containers []AlamedaContainer `json:"containers" protobuf:"bytes,1,opt,name=containers"`
}

AlamedaRecommendationSpec defines the desired state of AlamedaRecommendation

func (*AlamedaRecommendationSpec) DeepCopy

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

func (*AlamedaRecommendationSpec) DeepCopyInto

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

type AlamedaRecommendationStatus

type AlamedaRecommendationStatus struct {
}

AlamedaRecommendationStatus defines the observed state of AlamedaRecommendation

func (*AlamedaRecommendationStatus) DeepCopy

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

func (*AlamedaRecommendationStatus) DeepCopyInto

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

type AlamedaResource

type AlamedaResource struct {
	Namespace    string                        `json:"namespace" protobuf:"bytes,1,opt,name=namespace"`
	Name         string                        `json:"name" protobuf:"bytes,2,opt,name=name"`
	UID          string                        `json:"uid" protobuf:"bytes,3,opt,name=uid"`
	Pods         map[NamespacedName]AlamedaPod `json:"pods" protobuf:"bytes,4,opt,name=pods"`
	SpecReplicas *int32                        `json:"specReplicas" protobuf:"varint,5,opt,name=spec_replicas"`
}

func (*AlamedaResource) DeepCopy

func (in *AlamedaResource) DeepCopy() *AlamedaResource

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

func (*AlamedaResource) DeepCopyInto

func (in *AlamedaResource) DeepCopyInto(out *AlamedaResource)

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

type AlamedaScaler

type AlamedaScaler struct {
	Mgr      ctrl.Manager                      `json:"-"`
	Validate apivalidate.AlamedaScalerValidate `json:"-"`

	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   AlamedaScalerSpec   `json:"spec,omitempty"`
	Status AlamedaScalerStatus `json:"status,omitempty"`
}

AlamedaScaler is the Schema for the alamedascalers API +k8s:openapi-gen=true

func (*AlamedaScaler) DeepCopy

func (in *AlamedaScaler) DeepCopy() *AlamedaScaler

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

func (*AlamedaScaler) DeepCopyInto

func (in *AlamedaScaler) DeepCopyInto(out *AlamedaScaler)

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

func (*AlamedaScaler) DeepCopyObject

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

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

func (*AlamedaScaler) Default

func (r *AlamedaScaler) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*AlamedaScaler) GenCustomResourceVersion

func (as *AlamedaScaler) GenCustomResourceVersion() string

func (*AlamedaScaler) GetLabelMapToSetToAlamedaRecommendationLabel

func (as *AlamedaScaler) GetLabelMapToSetToAlamedaRecommendationLabel() map[string]string

func (*AlamedaScaler) GetLimitCPUMilliCores

func (as *AlamedaScaler) GetLimitCPUMilliCores() string

func (*AlamedaScaler) GetLimitMemoryBytes

func (as *AlamedaScaler) GetLimitMemoryBytes() string

func (*AlamedaScaler) GetMonitoredPods

func (as *AlamedaScaler) GetMonitoredPods() []*AlamedaPod

GetMonitoredPods returns pods restoring in AlamedaScaler.Status

func (*AlamedaScaler) GetRequestCPUMilliCores

func (as *AlamedaScaler) GetRequestCPUMilliCores() string

func (*AlamedaScaler) GetRequestMemoryBytes

func (as *AlamedaScaler) GetRequestMemoryBytes() string

func (*AlamedaScaler) HasAlamedaPod

func (as *AlamedaScaler) HasAlamedaPod(namespace, name string) bool

HasAlamedaPod returns true if the pod is reocording in AlamedaScaler.Status

func (*AlamedaScaler) IsEnableExecution

func (as *AlamedaScaler) IsEnableExecution() bool

func (*AlamedaScaler) IsScalingToolTypeHPA

func (as *AlamedaScaler) IsScalingToolTypeHPA() bool

func (*AlamedaScaler) IsScalingToolTypeVPA

func (as *AlamedaScaler) IsScalingToolTypeVPA() bool

func (*AlamedaScaler) SetCustomResourceVersion

func (as *AlamedaScaler) SetCustomResourceVersion(v string)

func (*AlamedaScaler) SetDefaultValue

func (as *AlamedaScaler) SetDefaultValue()

func (*AlamedaScaler) SetStatusAlamedaController

func (as *AlamedaScaler) SetStatusAlamedaController(ac AlamedaController)

func (*AlamedaScaler) SetupWebhookWithManager

func (r *AlamedaScaler) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*AlamedaScaler) ValidateCreate

func (r *AlamedaScaler) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*AlamedaScaler) ValidateDelete

func (r *AlamedaScaler) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*AlamedaScaler) ValidateUpdate

func (r *AlamedaScaler) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type AlamedaScalerList

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

AlamedaScalerList contains a list of AlamedaScaler

func (*AlamedaScalerList) DeepCopy

func (in *AlamedaScalerList) DeepCopy() *AlamedaScalerList

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

func (*AlamedaScalerList) DeepCopyInto

func (in *AlamedaScalerList) DeepCopyInto(out *AlamedaScalerList)

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

func (*AlamedaScalerList) DeepCopyObject

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

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

type AlamedaScalerSpec

type AlamedaScalerSpec struct {
	// Important: Run "make" to regenerate code after modifying this file
	Selector        *metav1.LabelSelector `json:"selector" protobuf:"bytes,1,name=selector"`
	EnableExecution *enableExecution      `json:"enableExecution,omitempty" protobuf:"bytes,2,name=enable_execution"`
	// +kubebuilder:validation:Enum=stable,compact
	Policy                alamedaPolicy   `json:"policy,omitempty" protobuf:"bytes,3,opt,name=policy"`
	CustomResourceVersion string          `json:"customResourceVersion,omitempty" protobuf:"bytes,4,opt,name=custom_resource_version"`
	ScalingTool           ScalingToolSpec `json:"scalingTool,omitempty" protobuf:"bytes,5,opt,name=scaling_tool"`
}

AlamedaScalerSpec defines the desired state of AlamedaScaler INSERT ADDITIONAL SPEC FIELDS - desired state of cluster

func (*AlamedaScalerSpec) DeepCopy

func (in *AlamedaScalerSpec) DeepCopy() *AlamedaScalerSpec

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

func (*AlamedaScalerSpec) DeepCopyInto

func (in *AlamedaScalerSpec) DeepCopyInto(out *AlamedaScalerSpec)

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

type AlamedaScalerStatus

type AlamedaScalerStatus struct {
	AlamedaController AlamedaController `json:"alamedaController,omitempty" protobuf:"bytes,4,opt,name=alameda_controller"`
}

AlamedaScalerStatus defines the observed state of AlamedaScaler

func (*AlamedaScalerStatus) DeepCopy

func (in *AlamedaScalerStatus) DeepCopy() *AlamedaScalerStatus

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

func (*AlamedaScalerStatus) DeepCopyInto

func (in *AlamedaScalerStatus) DeepCopyInto(out *AlamedaScalerStatus)

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

type ExecutionStrategy

type ExecutionStrategy struct {
	// +kubebuilder:validation:Pattern=^\d*[1-9]+\d*(%?$)$|^\d*[1-9]+\d*\.\d*(%?$)$|^\d*\.\d*[1-9]+\d*(%?$)$
	MaxUnavailable   string                       `json:"maxUnavailable,omitempty" protobuf:"bytes,1,name=max_unavailable"`
	TriggerThreshold *TriggerThreshold            `json:"triggerThreshold,omitempty" protobuf:"bytes,2,name=trigger_threshold"`
	Resources        *corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,3,name=resources"`
}

func NewDefaultExecutionStrategy

func NewDefaultExecutionStrategy() ExecutionStrategy

func (*ExecutionStrategy) DeepCopy

func (in *ExecutionStrategy) DeepCopy() *ExecutionStrategy

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

func (*ExecutionStrategy) DeepCopyInto

func (in *ExecutionStrategy) DeepCopyInto(out *ExecutionStrategy)

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

type NamespacedName

type NamespacedName = string

type ScalingToolSpec

type ScalingToolSpec struct {
	// +kubebuilder:validation:Enum=,vpa,hpa,N/A
	Type              string             `json:"type,omitempty" protobuf:"bytes,1,name=type"`
	ExecutionStrategy *ExecutionStrategy `json:"executionStrategy,omitempty" protobuf:"bytes,2,name=execution_strategy"`
}

func (*ScalingToolSpec) DeepCopy

func (in *ScalingToolSpec) DeepCopy() *ScalingToolSpec

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

func (*ScalingToolSpec) DeepCopyInto

func (in *ScalingToolSpec) DeepCopyInto(out *ScalingToolSpec)

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

type ScalingToolType

type ScalingToolType = string
const (
	ScalingToolTypeVPA     ScalingToolType = "vpa"
	ScalingToolTypeHPA     ScalingToolType = "hpa"
	ScalingToolTypeDefault ScalingToolType = "N/A"
)

type TriggerThreshold

type TriggerThreshold struct {
	// +kubebuilder:validation:Pattern=^\d*[1-9]+\d*%$|^\d*[1-9]+\d*\.\d*%$|^\d*\.\d*[1-9]+\d*%$
	CPU string `json:"cpu,omitempty" protobuf:"bytes,1,name=cpu"`
	// +kubebuilder:validation:Pattern=^\d*[1-9]+\d*%$|^\d*[1-9]+\d*\.\d*%$|^\d*\.\d*[1-9]+\d*%$
	Memory string `json:"memory,omitempty" protobuf:"bytes,2,name=memory"`
}

func NewDefaultTriggerThreshold

func NewDefaultTriggerThreshold() TriggerThreshold

func (*TriggerThreshold) DeepCopy

func (in *TriggerThreshold) DeepCopy() *TriggerThreshold

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

func (*TriggerThreshold) DeepCopyInto

func (in *TriggerThreshold) DeepCopyInto(out *TriggerThreshold)

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