ipam

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// The max no. of NodeSpec updates that can be enqueued.
	CidrUpdateQueueSize = 5000
)

TODO: figure out the good setting for those constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type CIDRAllocator

type CIDRAllocator interface {
	// AllocateOrOccupyCIDR looks at the given node, assigns it a valid
	// CIDR if it doesn't currently have one or mark the CIDR as used if
	// the node already have one.
	AllocateOrOccupyCIDR(node *v1.Node) error
	// ReleaseCIDR releases the CIDR of the removed node
	ReleaseCIDR(node *v1.Node) error
	// Run starts all the working logic of the allocator.
	Run(ctx context.Context, stopCh <-chan struct{})

	ReadyChecker(_ *http.Request) error

	HealthzChecker(_ *http.Request) error
}

CIDRAllocator is an interface implemented by things that know how to allocate/occupy/recycle CIDR for nodes.

func NewCIDRRangeAllocator

func NewCIDRRangeAllocator(ctx context.Context, client *coreV1Client.CoreV1Client, ec2Client *ec2.Client, allocatorParams CIDRAllocatorParams, nodeInformer runtimecache.Informer, mode string, tickPeriod *time.Duration, nodeCIDRMaskSizeIPv6 int) (CIDRAllocator, error)

NewCIDRRangeAllocator returns a CIDRAllocator to allocate CIDRs for node (one from each of clusterCIDRs) Caller must ensure subNetMaskSize is not less than cluster CIDR mask size. Caller must always pass in a list of existing nodes so the new allocator. can initialize its CIDR map. NodeList is only nil in testing.

type CIDRAllocatorParams

type CIDRAllocatorParams struct {
	// ClusterCIDRs is list of cluster cidrs
	ClusterCIDRs []*net.IPNet
	// NodeCIDRMaskSizes is list of node cidr mask sizes
	NodeCIDRMaskSizes []int
}

CIDRAllocatorParams is parameters that's required for creating new cidr range allocator.

type Mode

type Mode string
const (
	// IPv4 defines the ipv4 ipam controller mode
	IPv4 Mode = "ipv4"
	// IPv6 defines the ipv6 ipam controller mode
	IPv6 Mode = "ipv6"
	// DualStack defines the dual-stack ipam controller mode
	DualStack Mode = "dual-stack"
)

type NodeReservedCIDRs

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

NodeReservedCIDRs holds the allocated CIDRs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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