allocator

package
v0.0.0-...-53bbe3b Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BifrostIPAllocator

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

BifrostIPAllocator

func NewBifrostIPAllocator

func NewBifrostIPAllocator(network string, k8sClient client.Client) *BifrostIPAllocator

NewBifrostIPAllocator

func (*BifrostIPAllocator) Get

func (a *BifrostIPAllocator) Get(id string, ifname string, requestedIP net.IP) (*current.IPConfig, error)

Get allocates an IP

func (*BifrostIPAllocator) Release

func (a *BifrostIPAllocator) Release(id string, ifname string) error

Release clears all IPs allocated for the container with given ID

type IPAMArgs

type IPAMArgs struct {
	IPs []net.IP `json:"ips"`
}

type IPAMConfig

type IPAMConfig struct {
	*Range
	Name           string
	Type           string         `json:"type"`
	KubeConfigPath string         `json:"kubeConfigPath"`
	Routes         []*types.Route `json:"routes"`
	DataDir        string         `json:"dataDir"`
	ResolvConf     string         `json:"resolvConf"`
	Ranges         []RangeSet     `json:"ranges"`
	IPArgs         []net.IP       `json:"-"` // Requested IPs from CNI_ARGS and args
}

IPAMConfig represents the IP related network configuration. This nests Range because we initially only supported a single range directly, and wish to preserve backwards compatability

func LoadIPAMConfig

func LoadIPAMConfig(bytes []byte, envArgs string) (*IPAMConfig, string, error)

NewIPAMConfig creates a NetworkConfig from the given network name.

type IPAMEnvArgs

type IPAMEnvArgs struct {
	types.CommonArgs
	IP net.IP `json:"ip,omitempty"`
}

type Net

type Net struct {
	Name          string      `json:"name"`
	CNIVersion    string      `json:"cniVersion"`
	IPAM          *IPAMConfig `json:"ipam"`
	RuntimeConfig struct {
		IPRanges []RangeSet `json:"ipRanges,omitempty"`
	} `json:"runtimeConfig,omitempty"`
	Args *struct {
		A *IPAMArgs `json:"cni"`
	} `json:"args"`
}

The top-level network config - IPAM plugins are passed the full configuration of the calling plugin, not just the IPAM section.

type Range

type Range struct {
	RangeStart net.IP      `json:"rangeStart,omitempty"` // The first ip, inclusive
	RangeEnd   net.IP      `json:"rangeEnd,omitempty"`   // The last ip, inclusive
	Subnet     types.IPNet `json:"subnet"`
	Gateway    net.IP      `json:"gateway,omitempty"`
}

type RangeSet

type RangeSet []Range

Jump to

Keyboard shortcuts

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