networkallocator

package
v0.0.0-...-120fae7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDriver defines the name of the driver to be used by
	// default if a network without any driver name specified is
	// created.
	DefaultDriver = "overlay"
)

Variables

This section is empty.

Functions

func OnInit

func OnInit(options *ServiceAllocationOpts)

OnInit is called for allocator initialization stage

Types

type NetworkAllocator

type NetworkAllocator struct {
	// contains filtered or unexported fields
}

NetworkAllocator acts as the controller for all network related operations like managing network and IPAM drivers and also creating and deleting networks and the associated resources.

func New

New returns a new NetworkAllocator handle

func (*NetworkAllocator) Allocate

func (na *NetworkAllocator) Allocate(n *api.Network) error

Allocate allocates all the necessary resources both general and driver-specific which may be specified in the NetworkSpec

func (*NetworkAllocator) AllocateNode

func (na *NetworkAllocator) AllocateNode(node *api.Node) error

AllocateNode allocates the IP addresses for the network to which the node is attached.

func (*NetworkAllocator) AllocateTask

func (na *NetworkAllocator) AllocateTask(t *api.Task) error

AllocateTask allocates all the endpoint resources for all the networks that a task is attached to.

func (*NetworkAllocator) Deallocate

func (na *NetworkAllocator) Deallocate(n *api.Network) error

Deallocate frees all the general and driver specific resources which were assigned to the passed network.

func (*NetworkAllocator) DeallocateNode

func (na *NetworkAllocator) DeallocateNode(node *api.Node) error

DeallocateNode deallocates the IP addresses for the network to which the node is attached.

func (*NetworkAllocator) DeallocateTask

func (na *NetworkAllocator) DeallocateTask(t *api.Task) error

DeallocateTask releases all the endpoint resources for all the networks that a task is attached to.

func (*NetworkAllocator) IsAllocated

func (na *NetworkAllocator) IsAllocated(n *api.Network) bool

IsAllocated returns if the passed network has been allocated or not.

func (*NetworkAllocator) IsNodeAllocated

func (na *NetworkAllocator) IsNodeAllocated(node *api.Node) bool

IsNodeAllocated returns if the passed node has its network resources allocated or not.

func (*NetworkAllocator) IsServiceAllocated

func (na *NetworkAllocator) IsServiceAllocated(s *api.Service, flags ...func(*ServiceAllocationOpts)) bool

IsServiceAllocated returns if the passed service has its network resources allocated or not. init bool indicates if the func is called during allocator initialization stage.

func (*NetworkAllocator) IsTaskAllocated

func (na *NetworkAllocator) IsTaskAllocated(t *api.Task) bool

IsTaskAllocated returns if the passed task has its network resources allocated or not.

func (*NetworkAllocator) PortsAllocatedInHostPublishMode

func (na *NetworkAllocator) PortsAllocatedInHostPublishMode(s *api.Service) bool

PortsAllocatedInHostPublishMode returns if the passed service has its published ports in host (non ingress) mode allocated

func (*NetworkAllocator) ServiceAllocate

func (na *NetworkAllocator) ServiceAllocate(s *api.Service) (err error)

ServiceAllocate allocates all the network resources such as virtual IP and ports needed by the service.

func (*NetworkAllocator) ServiceDeallocate

func (na *NetworkAllocator) ServiceDeallocate(s *api.Service) error

ServiceDeallocate de-allocates all the network resources such as virtual IP and ports associated with the service.

type ServiceAllocationOpts

type ServiceAllocationOpts struct {
	OnInit bool
}

ServiceAllocationOpts is struct used for functional options in IsServiceAllocated

Jump to

Keyboard shortcuts

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