package ipam

import "k8s.io/kubernetes/pkg/controller/node/ipam"

Index

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
}

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

func NewCIDRRangeAllocator

func NewCIDRRangeAllocator(client clientset.Interface, clusterCIDR *net.IPNet, serviceCIDR *net.IPNet, subNetMaskSize int, nodeList *v1.NodeList) (CIDRAllocator, error)

NewCIDRRangeAllocator returns a CIDRAllocator to allocate CIDR for node 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.

func NewCloudCIDRAllocator

func NewCloudCIDRAllocator(
	client clientset.Interface,
	cloud cloudprovider.Interface) (ca CIDRAllocator, err error)

NewCloudCIDRAllocator creates a new cloud CIDR allocator.

type CIDRAllocatorType

type CIDRAllocatorType string

CIDRAllocatorType is the type of the allocator to use.

const (
	// RangeAllocatorType is the allocator that uses an internal CIDR
	// range allocator to do node CIDR range allocations.
	RangeAllocatorType CIDRAllocatorType = "RangeAllocator"
	// CloudAllocatorType is the allocator that uses cloud platform
	// support to do node CIDR range allocations.
	CloudAllocatorType CIDRAllocatorType = "CloudAllocator"
)

Source Files

cidr_allocator.go cloud_cidr_allocator.go range_allocator.go

Directories

PathSynopsis
pkg/controller/node/ipam/cidrset
Version
v1.8.0-alpha.3
Published
Aug 23, 2017
Platform
js/wasm
Imports
20 packages
Last checked
16 minutes ago

Tools for package owners.