Documentation
¶
Index ¶
- Constants
- Variables
- func AveragePlan(_ context.Context, infos []Info, need, _, limit int) (map[string]int, error)
- func CommunismPlan(_ context.Context, infos []Info, need, total, limit int) (map[string]int, error)
- func Deploy(ctx context.Context, strategy string, count, nodesLimit int, ...) (map[string]int, error)
- func DrainedPlan(_ context.Context, infos []Info, need, total, _ int) (map[string]int, error)
- func FillPlan(_ context.Context, infos []Info, need, _, limit int) (_ map[string]int, err error)
- func GlobalPlan(_ context.Context, infos []Info, need, total, _ int) (map[string]int, error)
- type Info
Constants ¶
View Source
const ( Auto = "AUTO" Fill = "FILL" Each = "EACH" Global = "GLOBAL" Drained = "DRAINED" // Dummy marks a capacity-only request and has no entry in Plans Dummy = "DUMMY" )
Variables ¶
View Source
var Plans = map[string]strategyFunc{ Auto: CommunismPlan, Fill: FillPlan, Each: AveragePlan, Global: GlobalPlan, Drained: DrainedPlan, }
Functions ¶
func AveragePlan ¶
AveragePlan puts need workloads on each of limit nodes; need is per node, limit 0 means every node.
func CommunismPlan ¶
CommunismPlan spreads need workloads so the global per-node count ends as even as possible.
func Deploy ¶
func Deploy(ctx context.Context, strategy string, count, nodesLimit int, strategyInfos []Info, total int) (map[string]int, error)
Deploy spreads count workloads over strategyInfos by the named plan; a plan may reorder the slice.
func DrainedPlan ¶
DrainedPlan fills the lowest-capacity nodes first, draining each before moving to the next.
Types ¶
Click to show internal directories.
Click to hide internal directories.