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 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, constraints *v1alpha5.Constraints, pods []*v1.Pod, daemons []*v1.Pod) []*Packable
PackablesFor creates viable packables for the provided constraints, excluding those that can't fit resources or violate constraints.
type Packer ¶
type Packer struct {
// contains filtered or unexported fields
}
Packer packs pods and calculates efficient placement on the instances.
func NewPacker ¶ added in v0.5.2
func NewPacker(kubeClient client.Client, cloudProvider cloudprovider.CloudProvider) *Packer
func (*Packer) Pack ¶
func (p *Packer) Pack(ctx context.Context, constraints *v1alpha5.Constraints, pods []*v1.Pod, instanceTypes []cloudprovider.InstanceType) ([]*Packing, error)
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/First-fit-decreasing_bin_packing
type Packing ¶
type Packing struct { Pods [][]*v1.Pod `hash:"ignore"` NodeQuantity int `hash:"ignore"` InstanceTypeOptions []cloudprovider.InstanceType }
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).