storage

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 11 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 IPManagementEtcd

func IPManagementEtcd(ctx context.Context, 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(ctx context.Context, 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) GetOverlappingRangeStore

func (i *ETCDIPAM) GetOverlappingRangeStore() (OverlappingRangeStore, error)

GetOverlappingRangeStore returns an OverlappingRangeStore interface

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 EtcdOverlappingRangeStore

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

EtcdOverlappingRangeStore represents a set of cluster wide resources

func (*EtcdOverlappingRangeStore) IsAllocatedInOverlappingRange

func (i *EtcdOverlappingRangeStore) IsAllocatedInOverlappingRange(ctx context.Context, ip net.IP) (bool, error)

IsAllocatedInOverlappingRange checks to see if the IP is allocated across the whole cluster (and not just the current range)

func (*EtcdOverlappingRangeStore) UpdateOverlappingRangeAllocation

func (i *EtcdOverlappingRangeStore) UpdateOverlappingRangeAllocation(ctx context.Context, mode int, ip net.IP, containerID string, podRef string) error

UpdateOverlappingRangeAllocation updates our clusterwide allocation for overlapping ranges.

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 OverlappingRangeStore

type OverlappingRangeStore interface {
	IsAllocatedInOverlappingRange(ctx context.Context, ip net.IP) (bool, error)
	UpdateOverlappingRangeAllocation(ctx context.Context, mode int, ip net.IP, containerID string, podRef string) error
}

OverlappingRangeStore is an interface for wrapping overlappingrange storage options

type Store

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

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

type Temporary

type Temporary interface {
	Temporary() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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