Documentation ¶
Index ¶
- func BytesToIP(r []byte) net.IP
- func ListAllCIDRIPRangeIndexs(subnetCIDR *net.IPNet, sa networkingv1alpha1.SubnetAllocation) (indexRanges []*big.Int, err error)
- func ListAllCustomIPRangeIndexs(subnetCIDR *net.IPNet, customs []networkingv1alpha1.CustomAllocation) (indexRanges []*big.Int, err error)
- type IPFilter
- type RangePool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListAllCIDRIPRangeIndexs ¶
func ListAllCIDRIPRangeIndexs(subnetCIDR *net.IPNet, sa networkingv1alpha1.SubnetAllocation) (indexRanges []*big.Int, err error)
ListAllCIDRIPRangeIndexs The IP address range is listed in a list. Every two elements of the returned array are a group eg: [1,10, 10,100, 109,107] In the example array: if v=2, then v is in this element list. If v=101, v is not in this list
func ListAllCustomIPRangeIndexs ¶
func ListAllCustomIPRangeIndexs(subnetCIDR *net.IPNet, customs []networkingv1alpha1.CustomAllocation) (indexRanges []*big.Int, err error)
ListAllCustomIPRangeIndexs The IP address range is listed in a list. Every two elements of the returned array are a group eg: [1,10, 10,100, 109,107] In the example array: if v=2, then v is in this element list. If v=101, v is not in this list
Types ¶
type IPFilter ¶
IPFilter filte unavailable IP addresses this interface is used for filtering IP addresses which have been allocated by ipam
type RangePool ¶
type RangePool struct {
// contains filtered or unexported fields
}
RangePool manager ip pool control by range of ip
func NewCIDRRangePool ¶
func NewCIDRRangePool(psts *networkingv1alpha1.PodSubnetTopologySpread, ipFilter ...IPFilter) (*RangePool, error)
NewCIDRRangePool create new ip range manager This object is used by fixed IP and manually assigned IP
func NewCustomRangePool ¶
func NewCustomRangePool(psts *networkingv1alpha1.PodSubnetTopologySpread, ipFilter ...IPFilter) (*RangePool, error)
NewCustomRangePool create new ip range manager This object is used by custom mode of ipam
func (*RangePool) FirstAvailableIP ¶
FirstAvailableIP try to get the first available IP Return: IP address can be use for pod
nil if no ip can be used