Documentation
¶
Index ¶
- type Manager
- func (m Manager) AddNode(ctx context.Context, nodename string, opts resourcetypes.Resources, ...) (resourcetypes.Resources, error)
- func (m *Manager) AddPlugins(ps ...plugins.Plugin)
- func (m Manager) Alloc(ctx context.Context, nodename string, deployCount int, ...) ([]resourcetypes.Resources, []resourcetypes.Resources, error)
- func (m Manager) GetMetricsDescription(ctx context.Context) ([]*plugintypes.MetricsDescription, error)
- func (m Manager) GetMostIdleNode(ctx context.Context, nodenames []string) (string, error)
- func (m Manager) GetNodeMetrics(ctx context.Context, node *types.Node) ([]*plugintypes.Metrics, error)
- func (m Manager) GetNodeResourceInfo(ctx context.Context, nodename string, workloads []*types.Workload, fix bool) (resourcetypes.Resources, resourcetypes.Resources, []string, error)
- func (m Manager) GetNodesDeployCapacity(ctx context.Context, nodenames []string, opts resourcetypes.Resources) (map[string]*plugintypes.NodeDeployCapacity, int, error)
- func (m *Manager) LoadPlugins(ctx context.Context, embeddedETCD *embedded.Cluster) error
- func (m Manager) Realloc(ctx context.Context, nodename string, ...) (resourcetypes.Resources, resourcetypes.Resources, resourcetypes.Resources, ...)
- func (m Manager) Remap(ctx context.Context, nodename string, workloads []*types.Workload) (map[string]resourcetypes.Resources, error)
- func (m Manager) RemoveNode(ctx context.Context, nodename string) error
- func (m Manager) RollbackAlloc(ctx context.Context, nodename string, ...) error
- func (m Manager) RollbackRealloc(ctx context.Context, nodename string, workloadParams resourcetypes.Resources) error
- func (m Manager) SetNodeResourceCapacity(ctx context.Context, nodename string, ...) (resourcetypes.Resources, resourcetypes.Resources, error)
- func (m Manager) SetNodeResourceUsage(ctx context.Context, nodename string, ...) (resourcetypes.Resources, resourcetypes.Resources, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager fans resource operations out to the loaded plugins.
func (Manager) AddNode ¶
func (m Manager) AddNode(ctx context.Context, nodename string, opts resourcetypes.Resources, nodeInfo *enginetypes.Info) (resourcetypes.Resources, error)
func (*Manager) AddPlugins ¶
func (Manager) Alloc ¶
func (m Manager) Alloc(ctx context.Context, nodename string, deployCount int, opts resourcetypes.Resources) ([]resourcetypes.Resources, []resourcetypes.Resources, error)
Alloc allocates resource for deployCount workloads on nodename, keyed by plugin name in opts.
func (Manager) GetMetricsDescription ¶
func (m Manager) GetMetricsDescription(ctx context.Context) ([]*plugintypes.MetricsDescription, error)
func (Manager) GetMostIdleNode ¶
func (Manager) GetNodeMetrics ¶
func (Manager) GetNodeResourceInfo ¶
func (Manager) GetNodesDeployCapacity ¶
func (m Manager) GetNodesDeployCapacity(ctx context.Context, nodenames []string, opts resourcetypes.Resources) (map[string]*plugintypes.NodeDeployCapacity, int, error)
GetNodesDeployCapacity returns the nodes meeting every plugin's requirements, and their total capacity. the caller must hold the node locks
func (*Manager) LoadPlugins ¶
func (Manager) Realloc ¶
func (m Manager) Realloc(ctx context.Context, nodename string, nodeResource, opts resourcetypes.Resources) (resourcetypes.Resources, resourcetypes.Resources, resourcetypes.Resources, error)
func (Manager) Remap ¶
func (m Manager) Remap(ctx context.Context, nodename string, workloads []*types.Workload) (map[string]resourcetypes.Resources, error)
Remap returns engine params per workload, format: {"workload-1": {"cpus": ["1-3"]}}. remap never changes resource params
func (Manager) RollbackAlloc ¶
func (m Manager) RollbackAlloc(ctx context.Context, nodename string, workloadsParams []resourcetypes.Resources) error
RollbackAlloc returns the allocated resource to the node.
func (Manager) RollbackRealloc ¶
func (Manager) SetNodeResourceCapacity ¶
func (m Manager) SetNodeResourceCapacity(ctx context.Context, nodename string, nodeResource, nodeResourceRequest resourcetypes.Resources, delta, incr bool) (resourcetypes.Resources, resourcetypes.Resources, error)
SetNodeResourceCapacity updates node capacity from resource options rather than resource args.
func (Manager) SetNodeResourceUsage ¶
func (m Manager) SetNodeResourceUsage(ctx context.Context, nodename string, nodeResource, nodeResourceRequest resourcetypes.Resources, workloadsResource []resourcetypes.Resources, delta, incr bool) (resourcetypes.Resources, resourcetypes.Resources, error)
Click to show internal directories.
Click to hide internal directories.