kubernetes: k8s.io/kubernetes/pkg/controller/nodeipam/ipam/cidrset Index | Files

package cidrset

import "k8s.io/kubernetes/pkg/controller/nodeipam/ipam/cidrset"


Package Files

cidr_set.go metrics.go


var (
    // ErrCIDRRangeNoCIDRsRemaining occurs when there is no more space
    // to allocate CIDR ranges.
    ErrCIDRRangeNoCIDRsRemaining = errors.New(
        "CIDR allocation failed; there are no remaining CIDRs left to allocate in the accepted range")
    // ErrCIDRSetSubNetTooBig occurs when the subnet mask size is too
    // big compared to the CIDR mask size.
    ErrCIDRSetSubNetTooBig = errors.New(
        "New CIDR set failed; the node CIDR size is too big")

type CidrSet Uses

type CidrSet struct {
    // contains filtered or unexported fields

CidrSet manages a set of CIDR ranges from which blocks of IPs can be allocated from.

func NewCIDRSet Uses

func NewCIDRSet(clusterCIDR *net.IPNet, subNetMaskSize int) (*CidrSet, error)

NewCIDRSet creates a new CidrSet.

func (*CidrSet) AllocateNext Uses

func (s *CidrSet) AllocateNext() (*net.IPNet, error)

AllocateNext allocates the next free CIDR range. This will set the range as occupied and return the allocated range.

func (*CidrSet) Occupy Uses

func (s *CidrSet) Occupy(cidr *net.IPNet) (err error)

Occupy marks the given CIDR range as used. Occupy succeeds even if the CIDR range was previously used.

func (*CidrSet) Release Uses

func (s *CidrSet) Release(cidr *net.IPNet) error

Release releases the given CIDR range.

Package cidrset imports 9 packages (graph) and is imported by 6 packages. Updated 2020-11-25. Refresh now. Tools for package owners.