{"modulePath":"github.com/linode/linode-cloud-controller-manager","version":"v0.9.11","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ipam\n\nPackage ipam provides different allocators for assigning IP ranges to nodes. We currently support several kinds of IPAM allocators (these are denoted by the CIDRAllocatorType):\n\n  - RangeAllocator is an allocator that assigns PodCIDRs to nodes and works in conjunction with the RouteController to configure the network to get connectivity.\n  - CloudAllocator is an allocator that synchronizes PodCIDRs from IP ranges assignments from the underlying cloud platform.\n  - (Alpha only) IPAMFromCluster is an allocator that has the similar functionality as the RangeAllocator but also synchronizes cluster-managed ranges into the cloud platform.\n  - (Alpha only) IPAMFromCloud is the same as CloudAllocator (synchronizes from cloud into the cluster.)\n\n## Constants\n\n```go\nconst (\n\t// RangeAllocatorType is the allocator that uses an internal CIDR\n\t// range allocator to do node CIDR range allocations.\n\tRangeAllocatorType CIDRAllocatorType = \"RangeAllocator\"\n\t// CloudAllocatorType is the allocator that uses cloud platform\n\t// support to do node CIDR range allocations.\n\tCloudAllocatorType CIDRAllocatorType = \"CloudAllocator\"\n\t// IPAMFromClusterAllocatorType uses the ipam controller sync'ing the node\n\t// CIDR range allocations from the cluster to the cloud.\n\tIPAMFromClusterAllocatorType = \"IPAMFromCluster\"\n\t// IPAMFromCloudAllocatorType uses the ipam controller sync'ing the node\n\t// CIDR range allocations from the cloud to the cluster.\n\tIPAMFromCloudAllocatorType = \"IPAMFromCloud\"\n)\n```\n\n## Types\n\n```go\ntype CIDRAllocator interface {\n\t// AllocateOrOccupyCIDR looks at the given node, assigns it a valid\n\t// CIDR if it doesn't currently have one or mark the CIDR as used if\n\t// the node already have one.\n\tAllocateOrOccupyCIDR(ctx context.Context, node *v1.Node) error\n\t// ReleaseCIDR releases the CIDR of the removed node.\n\tReleaseCIDR(logger klog.Logger, node *v1.Node) error\n\t// Run starts all the working logic of the allocator.\n\tRun(ctx context.Context)\n}\n```\nCIDRAllocator is an interface implemented by things that know how to allocate/occupy/recycle CIDR for nodes.\n\n```go\nfunc New(ctx context.Context, linodeClient client.Client, kubeClient clientset.Interface, cloud cloudprovider.Interface, nodeInformer informers.NodeInformer, allocatorType CIDRAllocatorType, allocatorParams CIDRAllocatorParams) (CIDRAllocator, error)\n```\nNew creates a new CIDR range allocator.\n\n```go\nfunc NewLinodeCIDRAllocator(ctx context.Context, linodeClient linode.Client, client clientset.Interface, nodeInformer informers.NodeInformer, allocatorParams CIDRAllocatorParams, nodeList *v1.NodeList) (CIDRAllocator, error)\n```\nNewLinodeCIDRAllocator returns a CIDRAllocator to allocate CIDRs 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. Caller must ensure that ClusterCIDR is semantically correct can initialize its CIDR map. NodeList is only nil in testing.\n\n```go\ntype CIDRAllocatorParams struct {\n\t// ClusterCIDRs is list of cluster cidrs.\n\tClusterCIDRs []*net.IPNet\n\t// ServiceCIDR is primary service cidr for cluster.\n\tServiceCIDR *net.IPNet\n\t// SecondaryServiceCIDR is secondary service cidr for cluster.\n\tSecondaryServiceCIDR *net.IPNet\n\t// NodeCIDRMaskSizes is list of node cidr mask sizes.\n\tNodeCIDRMaskSizes             []int\n\tDisableIPv6NodeCIDRAllocation bool\n}\n```\nCIDRAllocatorParams is parameters that's required for creating new cidr range allocator.\n\n```go\ntype CIDRAllocatorType string\n```\nCIDRAllocatorType is the type of the allocator to use.\n\n","path":"github.com/linode/linode-cloud-controller-manager/cloud/nodeipam/ipam","name":"ipam","synopsis":"Package ipam provides different allocators for assigning IP ranges to nodes.","isRedistributable":true}
