v1alpha1

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DemandPhaseEmpty is the state of a demand object when it is first created
	DemandPhaseEmpty string = ""
	// DemandPhasePending is the state a demand object is in when Scaler has acknowledged it but has not yet taken
	// action to fulfill the demand
	DemandPhasePending string = "pending"
	// DemandPhaseFulfilled is the state a demand object is in when Scaler has taken action and the action has completed
	// to fulfill the demand. At this point, it is expected that there is capacity to meet the demand the object represents
	DemandPhaseFulfilled string = "fulfilled"
	// DemandPhaseCannotFulfill is the state a demand object is in when Scaler is unable to satisfy the demand. This is
	// possible if the demand contains a single unit that is larger than the instance group is configured to use, or if
	// the instance group has reached its maximum capacity and cannot allocate more
	DemandPhaseCannotFulfill string = "cannot-fulfill"
)
View Source
const GroupName = "scaler.palantir.com"

GroupName used for resources from this package.

Variables

View Source
var (
	// SchemeBuilder is a runtime SchemaBuilder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is a SchemaBuilder AddToSchema function
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	// AllDemandPhases is a list of all phases that a demand object could be in
	AllDemandPhases = []string{
		DemandPhaseEmpty,
		DemandPhasePending,
		DemandPhaseFulfilled,
		DemandPhaseCannotFulfill,
	}
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion represents the kubernetes schema.GroupVersion for the demand resource

Functions

func DemandCustomResourceDefinition

func DemandCustomResourceDefinition() v1beta1.CustomResourceDefinition

DemandCustomResourceDefinition returns the CustomResourceDefinition for the demand resource

func DemandCustomResourceDefinitionName

func DemandCustomResourceDefinitionName() string

DemandCustomResourceDefinitionName returns the demand resource name as a string

func DemandGroupVersionResource

func DemandGroupVersionResource() schema.GroupVersionResource

DemandGroupVersionResource returns the schema.GroupVersionResource for the demand resource

func Kind

func Kind(kind string) schema.GroupKind

Kind returns the schema.GroupKind for the demand resource

func Resource

func Resource(resource string) schema.GroupResource

Resource returns the schema.GroupResource for the demand resource

Types

type Demand

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

	Spec   DemandSpec   `json:"spec,omitempty"`
	Status DemandStatus `json:"status,omitempty"`
}

Demand represents currently unschedulable resources.

func (*Demand) DeepCopy

func (in *Demand) DeepCopy() *Demand

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

func (*Demand) DeepCopyInto

func (in *Demand) DeepCopyInto(out *Demand)

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

func (*Demand) DeepCopyObject

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

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

type DemandList

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

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

DemandList is a list of Demand resources

func (*DemandList) DeepCopy

func (in *DemandList) DeepCopy() *DemandList

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

func (*DemandList) DeepCopyInto

func (in *DemandList) DeepCopyInto(out *DemandList)

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

func (*DemandList) DeepCopyObject

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

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

type DemandSpec

type DemandSpec struct {
	Units         []DemandUnit `json:"units"`
	InstanceGroup string       `json:"instance-group"`

	// IsLongLived changes the lifecycle for a demand from
	// ephemeral and immutable to long-lived and mutable.
	// This is useful to set a buffer in an instance-group:
	// an amount of compute resources that is left unused
	// but ready for quick reservation should there be need.
	IsLongLived bool `json:"is-long-lived"`
}

DemandSpec represents the units and status of a Demand resource

func (*DemandSpec) DeepCopy

func (in *DemandSpec) DeepCopy() *DemandSpec

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

func (*DemandSpec) DeepCopyInto

func (in *DemandSpec) DeepCopyInto(out *DemandSpec)

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

type DemandStatus

type DemandStatus struct {
	Phase string `json:"phase"`
}

DemandStatus represents the status a demand object is in

func (*DemandStatus) DeepCopy

func (in *DemandStatus) DeepCopy() *DemandStatus

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

func (*DemandStatus) DeepCopyInto

func (in *DemandStatus) DeepCopyInto(out *DemandStatus)

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

type DemandUnit

type DemandUnit struct {
	CPU    resource.Quantity `json:"cpu"`
	Memory resource.Quantity `json:"memory"`
	Count  int               `json:"count"`
}

DemandUnit represents a single unit of demand as a count of CPU and Memory requirements

func (*DemandUnit) DeepCopy

func (in *DemandUnit) DeepCopy() *DemandUnit

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

func (*DemandUnit) DeepCopyInto

func (in *DemandUnit) DeepCopyInto(out *DemandUnit)

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