Documentation
¶
Index ¶
Constants ¶
View Source
const ( // AnnotationReservedIP is the annotation key used to reserve an IP AnnotationReservedIP = "ipv4.bonding.vpn.gardener.cloud/reserved" // AnnotationReservedIP is the annotation key used to store an IP as used AnnotationUsedIP = "ipv4.bonding.vpn.gardener.cloud/used" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPAddressBroker ¶
type IPAddressBroker = *ipAddressBroker
IPAddressBroker is the broker to retrieve a IP from the IP pool
func NewIPAddressBroker ¶
func NewIPAddressBroker(manager IPPoolManager, cfg *config.VPNClient) (IPAddressBroker, error)
NewIPAddressBroker creates a new instance.
type IPPoolManager ¶
type IPPoolManager interface {
// UsageLookup collects all IPs used or reserved.
UsageLookup(ctx context.Context, podName string) (*IPPoolUsageLookupResult, error)
// SetIPAddress sets an IP for a pod name as reserved or used.
SetIPAddress(ctx context.Context, podName, ip string, used bool) error
}
IPPoolManager provides methods to get IP pool usage and for adding new reservations or uses.
func NewPodIPPoolManager ¶
func NewPodIPPoolManager(namespace, labelSelector string) (IPPoolManager, error)
NewPodIPPoolManager create a new IPPoolManager based on pod annotations.
type IPPoolUsageLookupResult ¶
type IPPoolUsageLookupResult struct {
// OwnName is the own pod name
OwnName string
// IP used by own pod
OwnIP string
// OwnUsed is true if the own IP is marked as used
OwnUsed bool
// ForeignUsed are the set of IPs used by other pods
ForeignUsed map[string]struct{}
// ForeignReserved are the set of IPs reserved by other pods
ForeignReserved map[string]struct{}
}
IPPoolUsageLookupResult contains the results of the IP pool lookup
Click to show internal directories.
Click to hide internal directories.