Documentation ¶
Overview ¶
Package ipam implements Azure IPAM logic
Index ¶
- type AzureAPI
- type InstancesManager
- func (m *InstancesManager) CreateNode(obj *v2.CiliumNode, n *ipam.Node) ipam.NodeOperations
- func (m *InstancesManager) DeleteInstance(instanceID string)
- func (m *InstancesManager) GetPoolQuota() (quota ipamTypes.PoolQuotaMap)
- func (m *InstancesManager) HasInstance(instanceID string) bool
- func (m *InstancesManager) InstanceSync(ctx context.Context, instanceID string) time.Time
- func (m *InstancesManager) Resync(ctx context.Context) time.Time
- type Node
- func (n *Node) AllocateIPs(ctx context.Context, a *ipam.AllocationAction) error
- func (n *Node) CreateInterface(ctx context.Context, allocation *ipam.AllocationAction, ...) (int, string, error)
- func (n *Node) GetMaximumAllocatableIPv4() int
- func (n *Node) GetMinimumAllocatableIPv4() int
- func (n *Node) GetUsedIPWithPrefixes() int
- func (n *Node) IsPrefixDelegated() bool
- func (n *Node) PopulateStatusFields(k8sObj *v2.CiliumNode)
- func (n *Node) PrepareIPAllocation(scopedLog *logrus.Entry) (a *ipam.AllocationAction, err error)
- func (n *Node) PrepareIPRelease(excessIPs int, scopedLog *logrus.Entry) *ipam.ReleaseAction
- func (n *Node) ReleaseIPs(ctx context.Context, r *ipam.ReleaseAction) error
- func (n *Node) ResyncInterfacesAndIPs(ctx context.Context, scopedLog *logrus.Entry) (available ipamTypes.AllocationMap, stats stats.InterfaceStats, err error)
- func (n *Node) UpdatedNode(obj *v2.CiliumNode)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureAPI ¶
type AzureAPI interface { GetInstances(ctx context.Context, subnets ipamTypes.SubnetMap) (*ipamTypes.InstanceMap, error) GetVpcsAndSubnets(ctx context.Context) (ipamTypes.VirtualNetworkMap, ipamTypes.SubnetMap, error) AssignPrivateIpAddressesVM(ctx context.Context, subnetID, interfaceName string, addresses int) error AssignPrivateIpAddressesVMSS(ctx context.Context, instanceID, vmssName, subnetID, interfaceName string, addresses int) error }
AzureAPI is the API surface used of the Azure API
type InstancesManager ¶
type InstancesManager struct {
// contains filtered or unexported fields
}
InstancesManager maintains the list of instances. It must be kept up to date by calling resync() regularly.
func NewInstancesManager ¶
func NewInstancesManager(api AzureAPI) *InstancesManager
NewInstancesManager returns a new instances manager
func (*InstancesManager) CreateNode ¶
func (m *InstancesManager) CreateNode(obj *v2.CiliumNode, n *ipam.Node) ipam.NodeOperations
CreateNode is called on discovery of a new node
func (*InstancesManager) DeleteInstance ¶
func (m *InstancesManager) DeleteInstance(instanceID string)
DeleteInstance delete instance from m.instances
func (*InstancesManager) GetPoolQuota ¶
func (m *InstancesManager) GetPoolQuota() (quota ipamTypes.PoolQuotaMap)
GetPoolQuota returns the number of available IPs in all IP pools
func (*InstancesManager) HasInstance ¶
func (m *InstancesManager) HasInstance(instanceID string) bool
HasInstance returns whether the instance is in instances
func (*InstancesManager) InstanceSync ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a node representing an Azure instance
func (*Node) AllocateIPs ¶
AllocateIPs performs the Azure IP allocation operation
func (*Node) CreateInterface ¶
func (n *Node) CreateInterface(ctx context.Context, allocation *ipam.AllocationAction, scopedLog *logrus.Entry) (int, string, error)
CreateInterface is called to create a new interface. This operation is currently not supported on Azure.
func (*Node) GetMaximumAllocatableIPv4 ¶
GetMaximumAllocatableIPv4 returns the maximum amount of IPv4 addresses that can be allocated to the instance
func (*Node) GetMinimumAllocatableIPv4 ¶
GetMinimumAllocatableIPv4 returns the minimum amount of IPv4 addresses that must be allocated to the instance.
func (*Node) GetUsedIPWithPrefixes ¶
func (*Node) IsPrefixDelegated ¶
func (*Node) PopulateStatusFields ¶
func (n *Node) PopulateStatusFields(k8sObj *v2.CiliumNode)
PopulateStatusFields fills in the status field of the CiliumNode custom resource with Azure specific information
func (*Node) PrepareIPAllocation ¶
PrepareIPAllocation returns the number of IPs that can be allocated/created.
func (*Node) PrepareIPRelease ¶
PrepareIPRelease prepares the release of IPs
func (*Node) ReleaseIPs ¶
ReleaseIPs performs the IP release operation
func (*Node) ResyncInterfacesAndIPs ¶
func (n *Node) ResyncInterfacesAndIPs(ctx context.Context, scopedLog *logrus.Entry) ( available ipamTypes.AllocationMap, stats stats.InterfaceStats, err error)
ResyncInterfacesAndIPs is called to retrieve interfaces and IPs known to the Azure API and return them
func (*Node) UpdatedNode ¶
func (n *Node) UpdatedNode(obj *v2.CiliumNode)
UpdatedNode is called when an update to the CiliumNode is received.