Documentation ¶
Index ¶
- Constants
- Variables
- func DemandCustomResourceDefinition() v1.CustomResourceDefinition
- func DemandCustomResourceDefinitionName() string
- func DemandCustomResourceDefinitionVersion() v1.CustomResourceDefinitionVersion
- func DemandGroupVersionResource() schema.GroupVersionResource
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type Demand
- type DemandList
- type DemandSpec
- type DemandStatus
- type DemandUnit
Constants ¶
const ( // DemandPhaseEmpty is the state of a demand object when it is first created DemandPhaseEmpty string = string(v1alpha2.DemandPhaseEmpty) // 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 = string(v1alpha2.DemandPhasePending) // 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 = string(v1alpha2.DemandPhaseFulfilled) // 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 = string(v1alpha2.DemandPhaseCannotFulfill) )
const GroupName = "scaler.palantir.com"
GroupName used for resources from this package.
Variables ¶
var ( // SchemeBuilder is a runtime SchemaBuilder SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme is a SchemaBuilder AddToSchema function AddToScheme = SchemeBuilder.AddToScheme )
var ( // AllDemandPhases is a list of all phases that a demand object could be in AllDemandPhases = v1alpha2.AllDemandPhases )
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
SchemeGroupVersion represents the kubernetes schema.GroupVersion for the demand resource
Functions ¶
func DemandCustomResourceDefinition ¶
func DemandCustomResourceDefinition() v1.CustomResourceDefinition
DemandCustomResourceDefinition returns the CustomResourceDefinition for the demand resource
func DemandCustomResourceDefinitionName ¶
func DemandCustomResourceDefinitionName() string
DemandCustomResourceDefinitionName returns the demand resource name as a string
func DemandCustomResourceDefinitionVersion ¶ added in v0.2.13
func DemandCustomResourceDefinitionVersion() v1.CustomResourceDefinitionVersion
DemandCustomResourceDefinitionVersion returns the CustomResourceDefinitionVersion for the demand resource
func DemandGroupVersionResource ¶
func DemandGroupVersionResource() schema.GroupVersionResource
DemandGroupVersionResource returns the schema.GroupVersionResource 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) ConvertFrom ¶ added in v0.2.13
func (d *Demand) ConvertFrom(srcRaw conversion.Hub) error
ConvertFrom converts from storage version v1alpha2 to v1alpha1
func (*Demand) ConvertTo ¶ added in v0.2.13
func (d *Demand) ConvertTo(dstRaw conversion.Hub) error
ConvertTo converts from v1alpha1 to the storage version v1alpha2
func (*Demand) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Demand.
func (*Demand) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Demand) DeepCopyObject ¶
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 denotes the demand phase. Phase string `json:"phase"` // LastTransitionTime denotes the last transition time of the demand phase. // If left empty, defaults to the creation time of the demand. // +optional LastTransitionTime metav1.Time `json:"last-transition-time,omitempty"` }
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"` GPU resource.Quantity `json:"gpu,omitempty"` 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.