v1alpha1

package
v0.0.0-...-f243925 Latest Latest
Warning

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

Go to latest
Published: May 24, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API. +groupName=scalingpolicy.kope.io

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: scalingpolicy.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func RegisterDeepCopies deprecated

func RegisterDeepCopies(scheme *runtime.Scheme) error

RegisterDeepCopies adds deep-copy functions to the given scheme. Public to allow building arbitrary schemes.

Deprecated: deepcopy registration will go away when static deepcopy is fully implemented.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ContainerScalingRule

type ContainerScalingRule struct {
	// Name of the container specified as a DNS_LABEL.
	// Each container in a pod must have a unique name (DNS_LABEL).
	// Cannot be updated.
	Name string `json:"name"`

	// Compute Resources required by this container.
	// cf Container resources
	// +optional
	Resources ResourceRequirements `json:"resources,omitempty"`
}

ContainerScalingRule defines how container resources are scaled

func (*ContainerScalingRule) DeepCopy

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

func (*ContainerScalingRule) DeepCopyInto

func (in *ContainerScalingRule) DeepCopyInto(out *ContainerScalingRule)

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

type DelayScaling

type DelayScaling struct {
	// Max is the input value skew we tolerate in the output value
	Max float64 `json:"max,omitempty"`

	// DelaySeconds is the delay before we scale down
	DelaySeconds int32 `json:"delaySeconds,omitempty"`
}

func (*DelayScaling) DeepCopy

func (in *DelayScaling) DeepCopy() *DelayScaling

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

func (*DelayScaling) DeepCopyInto

func (in *DelayScaling) DeepCopyInto(out *DelayScaling)

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

type ResourceRequirements

type ResourceRequirements struct {
	// Limits describes the maximum amount of compute resources allowed.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	// +optional
	Limits []ResourceScalingRule `json:"limits,omitempty"`
	// Requests describes the minimum amount of compute resources required.
	// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
	// otherwise to an implementation-defined value.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	// +optional
	Requests []ResourceScalingRule `json:"requests,omitempty"`
}

ResourceRequirements holds the functions for resource limits & requests TODO: Should we just embed this in the parent?

func (*ResourceRequirements) DeepCopy

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

func (*ResourceRequirements) DeepCopyInto

func (in *ResourceRequirements) DeepCopyInto(out *ResourceRequirements)

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

type ResourceScalingFunction

type ResourceScalingFunction struct {
	// Input is the source value to use as the input to scaling: `cores`, `memory`, `nodes`
	Input string `json:"input,omitempty"`

	// Base is the constant resource value we use regardless of input, the y-axis intercept
	Base resource.Quantity `json:"base,omitempty"`

	// Slope determines how fast the resource usage changes per unit of input.
	// For each Input unit, we increase resources by Slope
	Slope resource.Quantity `json:"slope,omitempty"`

	// Per divides Input before multiplying by Slope, allowing us to specify slopes of < 1m per input unit
	Per int32 `json:"int,omitempty"`

	// Segments defines a set of segments of the resource line.
	// In each segment we define the interval with which we change values.
	// This is typically used so that we resize for every input unit for small cluster,
	// but for larger clusters we only resize for changes of N units or more.
	// Where it is not otherwise defined, we assume a first value of { at: 0, every: 1 }
	Segments []ResourceScalingSegment `json:"segments,omitempty"`

	DelayScaleDown *DelayScaling `json:"delayScaleDown,omitempty"`
}

func (*ResourceScalingFunction) DeepCopy

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

func (*ResourceScalingFunction) DeepCopyInto

func (in *ResourceScalingFunction) DeepCopyInto(out *ResourceScalingFunction)

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

type ResourceScalingRule

type ResourceScalingRule struct {
	// Resource is the name of the resource we are scaling
	Resource v1.ResourceName `json:"resource"`

	// Function defines how the target resource usage
	// depends on a set of input values (such as cluster core count, number of nodes etc)
	Function ResourceScalingFunction `json:"function"`

	// Max limits the maximum computed value of the resource.
	// If the value computed is greater than Max, we will use Max instead
	Max resource.Quantity `json:"max,omitempty"`
}

func (*ResourceScalingRule) DeepCopy

func (in *ResourceScalingRule) DeepCopy() *ResourceScalingRule

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

func (*ResourceScalingRule) DeepCopyInto

func (in *ResourceScalingRule) DeepCopyInto(out *ResourceScalingRule)

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

type ResourceScalingSegment

type ResourceScalingSegment struct {
	// The segment applies to values greater than or equal to at.  The "closest" segment is selected
	At int64 `json:"at,omitempty"`

	// Every specifies the granularity to which we round.  We always round up to the next multiple of Every.
	Every int64 `json:"every,omitempty"`
}

ResourceScalingSegment describes a segment of input values and the rounding policy we apply to it

func (*ResourceScalingSegment) DeepCopy

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

func (*ResourceScalingSegment) DeepCopyInto

func (in *ResourceScalingSegment) DeepCopyInto(out *ResourceScalingSegment)

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

type ScalingPolicy

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

	Spec   ScalingPolicySpec   `json:"spec"`
	Status ScalingPolicyStatus `json:"status,omitempty"`
}

ScalingPolicy is a specification for an ScalingPolicy resource

func (*ScalingPolicy) DeepCopy

func (in *ScalingPolicy) DeepCopy() *ScalingPolicy

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

func (*ScalingPolicy) DeepCopyInto

func (in *ScalingPolicy) DeepCopyInto(out *ScalingPolicy)

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

func (*ScalingPolicy) DeepCopyObject

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

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

type ScalingPolicyList

type ScalingPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []ScalingPolicy `json:"items"`
}

ScalingPolicyList is a list of ScalingPolicy resources

func (*ScalingPolicyList) DeepCopy

func (in *ScalingPolicyList) DeepCopy() *ScalingPolicyList

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

func (*ScalingPolicyList) DeepCopyInto

func (in *ScalingPolicyList) DeepCopyInto(out *ScalingPolicyList)

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

func (*ScalingPolicyList) DeepCopyObject

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

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

type ScalingPolicySpec

type ScalingPolicySpec struct {

	// reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption
	// and will set the desired number of pods by using its Scale subresource.
	ScaleTargetRef autoscaling.CrossVersionObjectReference `json:"scaleTargetRef"`

	Containers []ContainerScalingRule `json:"containers" patchStrategy:"merge"`
}

ScalingPolicySpec is the spec for an ScalingPolicy resource

func (*ScalingPolicySpec) DeepCopy

func (in *ScalingPolicySpec) DeepCopy() *ScalingPolicySpec

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

func (*ScalingPolicySpec) DeepCopyInto

func (in *ScalingPolicySpec) DeepCopyInto(out *ScalingPolicySpec)

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

type ScalingPolicyStatus

type ScalingPolicyStatus struct {
}

ScalingPolicyStatus is the status for an ScalingPolicy resource

func (*ScalingPolicyStatus) DeepCopy

func (in *ScalingPolicyStatus) DeepCopy() *ScalingPolicyStatus

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

func (*ScalingPolicyStatus) DeepCopyInto

func (in *ScalingPolicyStatus) DeepCopyInto(out *ScalingPolicyStatus)

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