Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
// MaxInstanceTypes defines the number of instance type options to return to the cloud provider
MaxInstanceTypes = 20
)
Functions ¶
This section is empty.
Types ¶
type ByResourcesRequested ¶
type ByResourcesRequested struct{ SortablePods }
func (ByResourcesRequested) Less ¶
func (r ByResourcesRequested) Less(a, b int) bool
type Packable ¶
type Packable struct {
cloudprovider.InstanceType
// contains filtered or unexported fields
}
func PackableFor ¶
func PackableFor(i cloudprovider.InstanceType) *Packable
func PackablesFor ¶
func PackablesFor(ctx context.Context, instanceTypes []cloudprovider.InstanceType, schedule *scheduling.Schedule) []*Packable
PackablesFor creates viable packables for the provided schedule, excluding those that can't fit resources or violate schedule.
type Packer ¶
type Packer struct {
}
Packer packs pods and calculates efficient placement on the instances.
func (*Packer) Pack ¶
func (p *Packer) Pack(ctx context.Context, schedule *scheduling.Schedule, instances []cloudprovider.InstanceType) []*Packing
Pack returns the node packings for the provided pods. It computes a set of viable instance types for each packing of pods. InstanceType variety enables the cloud provider to make better cost and availability decisions. The instance types returned are sorted by resources. Pods provided are all schedulable in the same zone as tightly as possible. It follows the First Fit Decreasing bin packing technique, reference- https://en.wikipedia.org/wiki/Bin_packing_problem#First_Fit_Decreasing_(FFD)
type Packing ¶
type Packing struct {
Pods [][]*v1.Pod `hash:"ignore"`
NodeQuantity int `hash:"ignore"`
InstanceTypeOptions []cloudprovider.InstanceType
Constraints *v1alpha5.Constraints
}
Packing is a binpacking solution of equivalently schedulable pods to a set of viable instance types upon which they fit. All pods in the packing are within the specified constraints (e.g., labels, taints).
type SortablePods ¶
func (SortablePods) Len ¶
func (pods SortablePods) Len() int
func (SortablePods) Swap ¶
func (pods SortablePods) Swap(i, j int)