Exemplo n.º 1
0
func defaultPriorities() util.StringSet {
	return util.NewStringSet(
		// Prioritize nodes by least requested utilization.
		factory.RegisterPriorityFunction("LeastRequestedPriority", priorities.LeastRequestedPriority, 1),
		// Prioritizes nodes to help achieve balanced resource usage
		factory.RegisterPriorityFunction("BalancedResourceAllocation", priorities.BalancedResourceAllocation, 1),
		// spreads pods by minimizing the number of pods (belonging to the same service) on the same minion.
		factory.RegisterPriorityConfigFactory(
			"ServiceSpreadingPriority",
			factory.PriorityConfigFactory{
				Function: func(args factory.PluginFactoryArgs) algorithm.PriorityFunction {
					return priorities.NewServiceSpreadPriority(args.ServiceLister)
				},
				Weight: 1,
			},
		),
	)
}
Exemplo n.º 2
0
func defaultPriorities() util.StringSet {
	return util.NewStringSet(
		// Prioritize nodes by least requested utilization.
		factory.RegisterPriorityFunction("LeastRequestedPriority", algorithm.LeastRequestedPriority, 1),
		// spreads pods by minimizing the number of pods (belonging to the same service) on the same minion.
		factory.RegisterPriorityConfigFactory(
			"ServiceSpreadingPriority",
			func(args factory.PluginFactoryArgs) algorithm.PriorityConfig {
				return algorithm.PriorityConfig{
					Function: algorithm.NewServiceSpreadPriority(args.ServiceLister),
					Weight:   1,
				}
			},
		),
		// EqualPriority is a prioritizer function that gives an equal weight of one to all minions
		factory.RegisterPriorityFunction("EqualPriority", algorithm.EqualPriority, 0),
	)
}