ipam

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSyncInterval = time.Second * 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignIPResponse

type AssignIPResponse struct {
	EIPRefName string
	Address    string
}

type CIDRResource

type CIDRResource struct {
	EIPRefName    string
	CIDRs         []*net.IPNet
	Used          map[string]*EIPRef
	Size          int
	UsingKnownIPs bool
	Protocol      string
}

func (*CIDRResource) Contains

func (c *CIDRResource) Contains(ip net.IP) bool

func (*CIDRResource) IntersectsWith

func (c *CIDRResource) IntersectsWith(ipnets []*net.IPNet) bool

func (*CIDRResource) IsFull

func (c *CIDRResource) IsFull() bool

type DataStore

type DataStore struct {
	IPPool map[string]*CIDRResource
	// contains filtered or unexported fields
}

func NewDataStore

func NewDataStore(log logr.Logger, bgpServer bgpserver.AnnounceBgp) *DataStore

func (*DataStore) AddEIPPool

func (d *DataStore) AddEIPPool(eip string, name string, usingKnownIPs bool, protocol string) error

func (*DataStore) AssignIP

func (d *DataStore) AssignIP(serviceName, ns string, protocol string) (*AssignIPResponse, error)

func (*DataStore) AssignSpecifyIP

func (d *DataStore) AssignSpecifyIP(ipstr, protocol, serviceName, ns string) (*AssignIPResponse, error)

func (*DataStore) DelBalancer

func (d *DataStore) DelBalancer(ip string) error

func (*DataStore) GetEIPStatus

func (d *DataStore) GetEIPStatus(eip string) *EIPStatus

func (*DataStore) GetPoolUsage

func (d *DataStore) GetPoolUsage(name string) (v1alpha1.EipStatus, error)

func (*DataStore) RemoveEIPPool

func (d *DataStore) RemoveEIPPool(eip, name string) error

func (*DataStore) SetBalancer

func (d *DataStore) SetBalancer(ip string, nexthops []string) error

func (*DataStore) UnassignIP

func (d *DataStore) UnassignIP(ipstr string) error

type EIPRef

type EIPRef struct {
	EIPRefName string
	Address    string
	Service    types.NamespacedName
}

type EIPStatus

type EIPStatus struct {
	EIPRef *EIPRef
	Used   bool
	Exist  bool
}

type IPAM

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

func NewIPAM

func NewIPAM(log logr.Logger, ds *DataStore) *IPAM

func (*IPAM) Reconcile

func (i *IPAM) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*IPAM) SetupWithManager

func (i *IPAM) SetupWithManager(mgr manager.Manager) error

func (*IPAM) Start

func (i *IPAM) Start(stop <-chan struct{}) error

Jump to

Keyboard shortcuts

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