persistentips

package
v0.0.0-...-e0f77fc Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIgnoredIPAMClaim                   = errors.New("ignored IPAMClaim: it belongs to other network")
	ErrPersistentIPsNotAvailableOnNetwork = errors.New("ipam claims not supported on this network")
)

Functions

This section is empty.

Types

type IPAMClaimReconciler

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

IPAMClaimReconciler acts on IPAMClaim events handed off by the cluster network controller and allocates or releases IPs for IPAMClaims.

func NewIPAMClaimReconciler

func NewIPAMClaimReconciler(kube kube.InterfaceOVN, netConfig util.NetInfo, lister ipamclaimslister.IPAMClaimLister) *IPAMClaimReconciler

NewIPAMClaimReconciler builds a new PersistentIPsAllocator

func (*IPAMClaimReconciler) FindIPAMClaim

func (icr *IPAMClaimReconciler) FindIPAMClaim(claimName string, namespace string) (*ipamclaimsapi.IPAMClaim, error)

func (*IPAMClaimReconciler) Reconcile

func (icr *IPAMClaimReconciler) Reconcile(
	oldIPAMClaim *ipamclaimsapi.IPAMClaim,
	newIPAMClaim *ipamclaimsapi.IPAMClaim,
	ipReleaser IPReleaser,
) error

Reconcile updates an IPAMClaim with the IP addresses allocated to the pod's interface

func (*IPAMClaimReconciler) Sync

func (icr *IPAMClaimReconciler) Sync(objs []interface{}, ipAllocator IPAllocator) error

Sync initializes the IPs allocator with the IPAMClaims already existing on the cluster. For live pods, therse are already allocated, so no error will be thrown (e.g. we ignore the `ipam.IsErrAllocated` error

type IPAllocator

type IPAllocator interface {
	AllocateIPs(ips []*net.IPNet) error
}

type IPReleaser

type IPReleaser interface {
	ReleaseIPs(ips []*net.IPNet) error
}

type PersistentAllocations

type PersistentAllocations interface {
	FindIPAMClaim(claimName string, namespace string) (*ipamclaimsapi.IPAMClaim, error)

	Reconcile(oldIPAMClaim *ipamclaimsapi.IPAMClaim, newIPAMClaim *ipamclaimsapi.IPAMClaim, ipReleaser IPReleaser) error
}

Jump to

Keyboard shortcuts

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