placement

package
v3.0.0-rc67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PolicyNames

func PolicyNames() []string

PolicyNames returns the placement policy names, in a stable order.

They are the candidates of the placement keyword, and its documentation is diffed from one agent version to the next: candidates coming out of a map in a different order every run would show as a change in every diff.

Types

type Policy

type Policy int

Policy is an integer representing the opensvc object placement policy.

const (
	// Invalid is for invalid kinds
	Invalid Policy = iota
	// None is the policy used by special objects like sec, cfg, usr.
	None
	// NodesOrder is the policy where node priorities are assigned to nodes descending from left to right in the nodes list.
	NodesOrder
	// LastStart is the policy where node priorities are assigned to nodes based on instance last start time. The more recent, the higher the priority.
	LastStart
	// LoadAvg is the policy where node priorities are assigned to nodes based on load average. The higher the load, the lower the priority.
	LoadAvg
	// Shift is the policy where node priorities are assigned to nodes based on the scaler slice number.
	Shift
	// Spread is the policy where node priorities are assigned to nodes based on nodename hashing. The node priority is stable as long as the cluster members are stable.
	Spread
	// Score is the policy where node priorities are assigned to nodes based on score. The higher the score, the higher the priority.
	Score
)

func NewPolicy

func NewPolicy(s string) Policy

NewPolicy returns a id from its string representation.

func (Policy) MarshalText

func (t Policy) MarshalText() ([]byte, error)

MarshalText marshals the enum as a quoted json string

func (Policy) String

func (t Policy) String() string

func (*Policy) UnmarshalText

func (t *Policy) UnmarshalText(b []byte) error

UnmarshalText unmashals a quoted json string to the enum value

type State

type State int

State is optimal when the running <n> instances are placed on the <n> first nodes of the candidate list sorted by the selected placement policy.

const (
	Undef State = iota
	NotApplicable
	Optimal
	NonOptimal
)

func (State) MarshalText

func (t State) MarshalText() ([]byte, error)

MarshalText marshals the enum as a quoted json string

func (State) String

func (t State) String() string

func (*State) UnmarshalText

func (t *State) UnmarshalText(b []byte) error

UnmarshalText unmashals a quoted json string to the enum value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL