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
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 ( // 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
Get a string representation of the dependencies found in the container config.
type Filter ¶
type Filter interface { Name() string // Return a subset of nodes that were accepted by the filtering policy. Filter(*cluster.ContainerConfig, []*node.Node, bool) ([]*node.Node, error) // Return 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