Documentation ¶
Index ¶
- Constants
- Variables
- func AveragePlan(ctx 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(ctx context.Context, infos []Info, need, _, limit int) (_ map[string]int, err error)
- func GlobalPlan(ctx context.Context, infos []Info, need, total, _ int) (map[string]int, error)
- type Info
Constants ¶
View Source
const ( // Auto . Auto = "AUTO" // Fill . Fill = "FILL" // Each . Each = "EACH" // Global . Global = "GLOBAL" // Drained . Drained = "DRAINED" // Dummy for calculate capacity Dummy = "DUMMY" )
Variables ¶
View Source
var Plans = map[string]strategyFunc{ Auto: CommunismPlan, Fill: FillPlan, Each: AveragePlan, Global: GlobalPlan, Drained: DrainedPlan, }
Plans .
Functions ¶
func AveragePlan ¶
AveragePlan deploy workload each node 容量够的机器每一台部署 N 个 need 是每台机器所需总量,limit 是限制节点数, 保证本轮增量部署 need*limit 个实例 limit = 0 即对所有节点部署
func CommunismPlan ¶
CommunismPlan 吃我一记共产主义大锅饭 部署完 N 个后全局尽可能平均
func Deploy ¶
func Deploy(ctx context.Context, strategy string, count, nodesLimit int, strategyInfos []Info, total int) (map[string]int, error)
Deploy .
func DrainedPlan ¶
DrainedPlan 优先往Capacity最小的节点部署,尽可能把节点的资源榨干在部署下一台.
Types ¶
Click to show internal directories.
Click to hide internal directories.