price

package
v0.0.0-...-e4898a9 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilter

func NewFilter(cloudProvider cloudprovider.CloudProvider,
	preferredNodeProvider PreferredNodeProvider,
	nodeUnfitness NodeUnfitness,
) expander.Filter

NewFilter returns an expansion filter 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