storage

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RequestTimeout defines how long the context timesout in
	RequestTimeout = 10 * time.Second

	// DatastoreRetries defines how many retries are attempted when updating the Pool
	DatastoreRetries = 100
)
View Source
var (
	// DialTimeout defines how long we dial etcd
	DialTimeout = 2 * time.Second
)

Functions

func IPManagement

func IPManagement(mode int, ipamConf types.IPAMConfig, containerID string, podRef string) (net.IPNet, error)

IPManagement manages ip allocation and deallocation from a storage perspective

Types

type ETCDIPAM

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

ETCDIPAM manages ip blocks in an etcd backend

func NewETCDIPAM

func NewETCDIPAM(ipamConf types.IPAMConfig) (*ETCDIPAM, error)

NewETCDIPAM returns a new IPAM Client configured to an etcd backend

func (*ETCDIPAM) Close

func (i *ETCDIPAM) Close() error

Close shuts down the clients etcd connections

func (*ETCDIPAM) GetIPPool

func (i *ETCDIPAM) GetIPPool(ctx context.Context, ipRange string) (IPPool, error)

GetIPPool returns a storage.IPPool for the given range

func (*ETCDIPAM) Status

func (i *ETCDIPAM) Status(ctx context.Context) error

Status tests connectivity to the etcd backend

type ETCDIPPool

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

ETCDIPPool represents a range and its parsed set of allocations

func (*ETCDIPPool) Allocations

func (p *ETCDIPPool) Allocations() []types.IPReservation

Allocations returns the initially retrieved set of allocations for this pool

func (*ETCDIPPool) Update

func (p *ETCDIPPool) Update(ctx context.Context, reservations []types.IPReservation) error

Update sets the pool allocated IP list to the given IP reservations

type IPPool

type IPPool interface {
	Allocations() []types.IPReservation
	Update(ctx context.Context, reservations []types.IPReservation) error
}

IPPool is the interface that represents an manageable pool of allocated IPs

type KubernetesIPAM

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

KubernetesIPAM manages ip blocks in an kubernetes CRD backend

func NewKubernetesIPAM

func NewKubernetesIPAM(containerID string, ipamConf whereaboutstypes.IPAMConfig) (*KubernetesIPAM, error)

NewKubernetesIPAM returns a new KubernetesIPAM Client configured to a kubernetes CRD backend

func (*KubernetesIPAM) Close

func (i *KubernetesIPAM) Close() error

Close partially implements the Store interface

func (*KubernetesIPAM) GetIPPool

func (i *KubernetesIPAM) GetIPPool(ctx context.Context, ipRange string) (IPPool, error)

GetIPPool returns a storage.IPPool for the given range

func (*KubernetesIPAM) Status

func (i *KubernetesIPAM) Status(ctx context.Context) error

Status tests connectivity to the kubernetes backend

type KubernetesIPPool

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

KubernetesIPPool represents an IPPool resource and its parsed set of allocations

func (*KubernetesIPPool) Allocations

func (p *KubernetesIPPool) Allocations() []whereaboutstypes.IPReservation

Allocations returns the initially retrieved set of allocations for this pool

func (*KubernetesIPPool) Update

func (p *KubernetesIPPool) Update(ctx context.Context, reservations []whereaboutstypes.IPReservation) error

Update sets the pool allocated IP list to the given IP reservations

type Store

type Store interface {
	GetIPPool(ctx context.Context, ipRange string) (IPPool, error)
	Status(ctx context.Context) error
	Close() error
}

Store is the interface that wraps the basic IP Allocation methods on the underlying storage backend

Jump to

Keyboard shortcuts

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