price

package
v0.0.0-...-572177c Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStrategy

func NewStrategy(pricingModel cloudprovider.PricingModel,
	preferredNodeProvider PreferredNodeProvider,
	nodeUnfitness NodeUnfitness,
) expander.Strategy

NewStrategy returns an expansion strategy that picks nodes based on price and preferred node type.

func SimpleNodeUnfitness

func SimpleNodeUnfitness(preferredNode, evaluatedNode *apiv1.Node) float64

SimpleNodeUnfitness returns unfitness based on cpu only.

Types

type NodeUnfitness

type NodeUnfitness func(preferredNode, evaluatedNode *apiv1.Node) float64

NodeUnfitness is a function that returns a value that how much the evaluated node is "different" from the preferred node for the cluster. The value should be greater or equal 1 where 1 means that the node is perfect. 10 means that the node is very unfitted, although there is no upper bound on the value of this function.

type PreferredNodeProvider

type PreferredNodeProvider interface {
	// Node returns the preferred node for the cluster
	Node() (*apiv1.Node, error)
}

PreferredNodeProvider provides a node that would be, in-longer run, the most suited to the cluster needs.

type SimplePreferredNodeProvider

type SimplePreferredNodeProvider struct {
	// contains filtered or unexported fields
}

SimplePreferredNodeProvider returns preferred node based on the cluster size.

func NewSimplePreferredNodeProvider

func NewSimplePreferredNodeProvider(nodeLister kube_util.NodeLister) *SimplePreferredNodeProvider

NewSimplePreferredNodeProvider returns simple PreferredNodeProvider

func (*SimplePreferredNodeProvider) Node

func (spnp *SimplePreferredNodeProvider) Node() (*apiv1.Node, error)

Node returns preferred node.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL