Documentation ¶
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- func ResourceReservationCustomResourceDefinition(webhook *v1.WebhookClientConfig, ...) *v1.CustomResourceDefinition
- type Reservation
- type ResourceList
- type ResourceReservation
- type ResourceReservationList
- type ResourceReservationSpec
- type ResourceReservationStatus
Constants ¶
const ( // ResourceCPU is the name of CPU resource. ResourceCPU corev1.ResourceName = corev1.ResourceCPU // ResourceMemory is the name of Memory resource. ResourceMemory corev1.ResourceName = corev1.ResourceMemory // ResourceNvidiaGPU is the name of Nvidia GPU resource. ResourceNvidiaGPU corev1.ResourceName = "nvidia.com/gpu" )
Variables ¶
var ( // SchemeBuilder is the SchemeBuilder instance for the v1beta2 group SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme applies all the stored functions to the scheme. A non-nil error // indicates that one function failed and the attempt was abandoned. AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: sparkscheduler.GroupName, Version: "v1beta2"}
SchemeGroupVersion represents the kubernetes GroupVersion
var ( // SupportedV1Beta2ResourceTypes is the list of resources explicitly used for scheduling in this version of scheduler SupportedV1Beta2ResourceTypes = [...]corev1.ResourceName{ResourceCPU, ResourceMemory, ResourceNvidiaGPU} )
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource returns the GroupResource for a given resource
func ResourceReservationCustomResourceDefinition ¶
func ResourceReservationCustomResourceDefinition(webhook *v1.WebhookClientConfig, supportedVersions ...v1.CustomResourceDefinitionVersion) *v1.CustomResourceDefinition
ResourceReservationCustomResourceDefinition returns the CRD definition for resource reservations
Types ¶
type Reservation ¶
type Reservation struct { Node string `json:"node"` Resources ResourceList `json:"resources"` }
Reservation represents the reserved node and resources for a single process of a distributed application
func (*Reservation) DeepCopy ¶
func (in *Reservation) DeepCopy() *Reservation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Reservation.
func (*Reservation) DeepCopyInto ¶
func (in *Reservation) DeepCopyInto(out *Reservation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceList ¶
ResourceList maps from a resource type to a quantity, e.g. CPU:1
func (ResourceList) CPU ¶
func (r ResourceList) CPU() *resource.Quantity
CPU returns the number of cores for the reservation, if cores have not been specified, it returns 0.
func (ResourceList) DeepCopy ¶
func (in ResourceList) DeepCopy() ResourceList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceList.
func (ResourceList) DeepCopyInto ¶
func (in ResourceList) DeepCopyInto(out *ResourceList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourceList) Memory ¶
func (r *ResourceList) Memory() *resource.Quantity
Memory returns the amount of memory for the reservation, if memory has not been specified, it returns 0.
func (*ResourceList) NvidiaGPU ¶
func (r *ResourceList) NvidiaGPU() *resource.Quantity
NvidiaGPU returns the amount of Nvidia GPUs for the reservation, if Nvidia GPUs have not been specified, it returns 0.
type ResourceReservation ¶
type ResourceReservation struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ResourceReservationSpec `json:"spec"` Status ResourceReservationStatus `json:"status"` }
ResourceReservation is a collection of reservation objects for a distributed application
func (*ResourceReservation) DeepCopy ¶
func (in *ResourceReservation) DeepCopy() *ResourceReservation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReservation.
func (*ResourceReservation) DeepCopyInto ¶
func (in *ResourceReservation) DeepCopyInto(out *ResourceReservation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourceReservation) DeepCopyObject ¶
func (in *ResourceReservation) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ResourceReservation) Hub ¶
func (*ResourceReservation) Hub()
Hub defines v1beta2 as the storage version
type ResourceReservationList ¶
type ResourceReservationList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []ResourceReservation `json:"items"` }
ResourceReservationList represents a list of ResourceReservations
func (*ResourceReservationList) DeepCopy ¶
func (in *ResourceReservationList) DeepCopy() *ResourceReservationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReservationList.
func (*ResourceReservationList) DeepCopyInto ¶
func (in *ResourceReservationList) DeepCopyInto(out *ResourceReservationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ResourceReservationList) DeepCopyObject ¶
func (in *ResourceReservationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ResourceReservationSpec ¶
type ResourceReservationSpec struct {
Reservations map[string]Reservation `json:"reservations"`
}
ResourceReservationSpec represents reservations for the driver and executors of an application
func (*ResourceReservationSpec) DeepCopy ¶
func (in *ResourceReservationSpec) DeepCopy() *ResourceReservationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReservationSpec.
func (*ResourceReservationSpec) DeepCopyInto ¶
func (in *ResourceReservationSpec) DeepCopyInto(out *ResourceReservationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceReservationStatus ¶
ResourceReservationStatus shows which reservations are bound to which pod names
func (*ResourceReservationStatus) DeepCopy ¶
func (in *ResourceReservationStatus) DeepCopy() *ResourceReservationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReservationStatus.
func (*ResourceReservationStatus) DeepCopyInto ¶
func (in *ResourceReservationStatus) DeepCopyInto(out *ResourceReservationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.