Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyFilters(filters []Filter, config *cluster.ContainerConfig, nodes []*node.Node, ...) ([]*node.Node, error)
- func List() []string
- type AffinityFilter
- type ConstraintFilter
- type DependencyFilter
- func (f *DependencyFilter) Filter(config *cluster.ContainerConfig, nodes []*node.Node, _ bool) ([]*node.Node, error)
- func (f *DependencyFilter) GetFilters(config *cluster.ContainerConfig) ([]string, error)
- func (f *DependencyFilter) Name() string
- func (f *DependencyFilter) String(config *cluster.ContainerConfig) string
- type Filter
- type HealthFilter
- type PortFilter
- type SlotsFilter
- type WhitelistFilter
Constants ¶
const ( // EQ is exported EQ = iota // NOTEQ is exported NOTEQ )
Variables ¶
var ( // ErrNoHealthyNodeAvailable is exported ErrNoHealthyNodeAvailable = errors.New("No healthy node available in the cluster") )
var ( // ErrNoNodeWithFreeSlotsAvailable is exported ErrNoNodeWithFreeSlotsAvailable = errors.New("No node with enough open slots available in the cluster") )
var ( // ErrNotSupported is exported. ErrNotSupported = errors.New("filter not supported") )
var OPERATORS = []string{"==", "!="}
OPERATORS is exported
Functions ¶
Types ¶
type AffinityFilter ¶
type AffinityFilter struct { }
AffinityFilter selects only nodes based on other containers on the node.
func (*AffinityFilter) Filter ¶
func (f *AffinityFilter) Filter(config *cluster.ContainerConfig, nodes []*node.Node, soft bool) ([]*node.Node, error)
Filter is exported
func (*AffinityFilter) GetFilters ¶ added in v1.2.0
func (f *AffinityFilter) GetFilters(config *cluster.ContainerConfig) ([]string, error)
GetFilters returns a list of the affinities found in the container config.
func (*AffinityFilter) Name ¶ added in v0.2.0
func (f *AffinityFilter) Name() string
Name returns the name of the filter
type ConstraintFilter ¶
type ConstraintFilter struct { }
ConstraintFilter selects only nodes that match certain labels.
func (*ConstraintFilter) Filter ¶
func (f *ConstraintFilter) Filter(config *cluster.ContainerConfig, nodes []*node.Node, soft bool) ([]*node.Node, error)
Filter is exported
func (*ConstraintFilter) GetFilters ¶ added in v1.2.0
func (f *ConstraintFilter) GetFilters(config *cluster.ContainerConfig) ([]string, error)
GetFilters returns a list of the constraints found in the container config.
func (*ConstraintFilter) Name ¶ added in v0.2.0
func (f *ConstraintFilter) Name() string
Name returns the name of the filter
type DependencyFilter ¶
type DependencyFilter struct { }
DependencyFilter co-schedules dependent containers on the same node.
func (*DependencyFilter) Filter ¶
func (f *DependencyFilter) Filter(config *cluster.ContainerConfig, nodes []*node.Node, _ bool) ([]*node.Node, error)
Filter is exported.
func (*DependencyFilter) GetFilters ¶ added in v1.2.0
func (f *DependencyFilter) GetFilters(config *cluster.ContainerConfig) ([]string, error)
GetFilters returns a list of the dependencies found in the container config.
func (*DependencyFilter) Name ¶ added in v0.2.0
func (f *DependencyFilter) Name() string
Name returns the name of the filter.
func (*DependencyFilter) String ¶
func (f *DependencyFilter) String(config *cluster.ContainerConfig) string
String gets a string representation of the dependencies found in the container config.
type Filter ¶
type Filter interface { Name() string // Filter returns a subset of nodes that were accepted by the filtering policy. Filter(*cluster.ContainerConfig, []*node.Node, bool) ([]*node.Node, error) // GetFilters returns a list of constraints/filters provided. GetFilters(*cluster.ContainerConfig) ([]string, error) }
Filter is exported
type HealthFilter ¶
type HealthFilter struct { }
HealthFilter only schedules containers on healthy nodes.
func (*HealthFilter) Filter ¶
func (f *HealthFilter) Filter(_ *cluster.ContainerConfig, nodes []*node.Node, _ bool) ([]*node.Node, error)
Filter is exported
func (*HealthFilter) GetFilters ¶ added in v1.2.0
func (f *HealthFilter) GetFilters(config *cluster.ContainerConfig) ([]string, error)
GetFilters returns
func (*HealthFilter) Name ¶ added in v0.2.0
func (f *HealthFilter) Name() string
Name returns the name of the filter
type PortFilter ¶
type PortFilter struct { }
PortFilter guarantees that, when scheduling a container binding a public port, only nodes that have not already allocated that same port will be considered.
func (*PortFilter) Filter ¶
func (p *PortFilter) Filter(config *cluster.ContainerConfig, nodes []*node.Node, _ bool) ([]*node.Node, error)
Filter is exported
func (*PortFilter) GetFilters ¶ added in v1.2.0
func (p *PortFilter) GetFilters(config *cluster.ContainerConfig) ([]string, error)
GetFilters returns a list of the port constraints found in the container config.
func (*PortFilter) Name ¶ added in v0.2.0
func (p *PortFilter) Name() string
Name returns the name of the filter
type SlotsFilter ¶ added in v1.2.1
type SlotsFilter struct { }
SlotsFilter only schedules containers with open slots.
func (*SlotsFilter) Filter ¶ added in v1.2.1
func (f *SlotsFilter) Filter(_ *cluster.ContainerConfig, nodes []*node.Node, _ bool) ([]*node.Node, error)
Filter is exported
func (*SlotsFilter) GetFilters ¶ added in v1.2.1
func (f *SlotsFilter) GetFilters(config *cluster.ContainerConfig) ([]string, error)
GetFilters returns just the info that this node failed, because there where no free slots
func (*SlotsFilter) Name ¶ added in v1.2.1
func (f *SlotsFilter) Name() string
Name returns the name of the filter
type WhitelistFilter ¶ added in v1.2.6
type WhitelistFilter struct { }
WhitelistFilter selects only nodes that are defined in a whitelist by the user
func (*WhitelistFilter) Filter ¶ added in v1.2.6
func (f *WhitelistFilter) Filter(config *cluster.ContainerConfig, nodes []*node.Node, soft bool) ([]*node.Node, error)
Filter is exported
func (*WhitelistFilter) GetFilters ¶ added in v1.2.6
func (f *WhitelistFilter) GetFilters(config *cluster.ContainerConfig) ([]string, error)
GetFilters returns a list of the whitelists found in the container config.
func (*WhitelistFilter) Name ¶ added in v1.2.6
func (f *WhitelistFilter) Name() string
Name returns the name of the filter