Documentation ¶
Overview ¶
Package allocator aims to manage allocation of different cluster-wide resources on behalf of the manager. In particular, it manages a set of independent allocator processes which can mostly execute concurrently with only a minimal need for coordination.
One of the instances where it needs coordination is when deciding to move a task to the PENDING state. Since a task can move to the PENDING state only when all the task allocators have completed, they must cooperate. The way `allocator` achieves this is by creating a `taskBallot` to which all task allocators register themselves as mandatory voters. For each task that needs allocation, each allocator independently votes to indicate the completion of their allocation. Once all registered voters have voted then the task is moved to the PENDING state.
Other than the coordination needed for task PENDING state, all the allocators function fairly independently.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoIngress is returned when no ingress network is found in store ErrNoIngress = errors.New("no ingress network found") )
Functions ¶
func GetIngressNetwork ¶
func GetIngressNetwork(s *store.MemoryStore) (*api.Network, error)
GetIngressNetwork fetches the ingress network from store. ErrNoIngress will be returned if the ingress network is not present, nil otherwise. In case of any other failure in accessing the store, the respective error will be reported as is.
func IsBuiltInNetworkDriver ¶
IsBuiltInNetworkDriver returns whether the passed driver is an internal network driver
func IsIngressNetwork ¶
IsIngressNetwork returns whether the passed network is an ingress network.
func IsIngressNetworkNeeded ¶
IsIngressNetworkNeeded checks whether the service requires the routing-mesh
func PredefinedNetworks ¶
func PredefinedNetworks() []networkallocator.PredefinedNetworkData
PredefinedNetworks returns the list of predefined network structures for a given network model
Types ¶
type Allocator ¶
type Allocator struct {
// contains filtered or unexported fields
}
Allocator controls how the allocation stage in the manager is handled.
func New ¶
func New(store *store.MemoryStore, pg plugingetter.PluginGetter, netConfig *cnmallocator.NetworkConfig) (*Allocator, error)
New returns a new instance of Allocator for use during allocation stage of the manager.