recommender

package
v0.0.0-...-bf1b93e Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScaleDownOrderedByDescendingCost

func ScaleDownOrderedByDescendingCost(ctx context.Context, vca scalesim.VirtualClusterAccess, w http.ResponseWriter, nodes []corev1.Node) ([]string, error)

ScaleDownOrderedByDescendingCost scales down the nodes in the cluster ordered by descending cost. It does the following

  1. Order all existing nodes by their cost.
  2. Iterate over all existing ordered nodes, for each node: 1.1 Taint the node with NoSchedule. 1.2 Get the pods on the node and deploy a copy of the pods with new names in the cluster. 1.3 Check whether there are un-scheduled pods. If len(unscheduledPods) == 0 { then delete the node from virtual cluster and record as recommendation else { mark as essential (not to be removed). Delete the newly deployed pods. Un-taint the node if this node is essential. }

Types

type Recommendation

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

type Recommender

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

func NewRecommender

func NewRecommender(engine scalesim.Engine, scenarioName, podOrder string, shoot *v1beta1.Shoot, instanceTypeCostRatios map[string]float64, strategyWeights StrategyWeights, logWriter http.ResponseWriter) *Recommender

func (*Recommender) Run

func (r *Recommender) Run(ctx context.Context, unscheduledPods []corev1.Pod) ([]Recommendation, error)

type StrategyWeights

type StrategyWeights struct {
	LeastWaste float64
	LeastCost  float64
}

Jump to

Keyboard shortcuts

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