Documentation ¶
Index ¶
- func HasBugBrokenVPCCidrs(meta MetadataClient) bool
- func Jitter(d time.Duration, pct float64) time.Duration
- type AllocateClient
- type AllocationResult
- type Bug
- type Client
- type ENILimit
- type Interface
- type InterfaceClient
- type Interfaces
- type LimitsClient
- type MetadataClient
- type Registry
- type Subnet
- type SubnetsByAvailableAddressCount
- type SubnetsClient
- type VPCClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasBugBrokenVPCCidrs ¶ added in v0.3.0
func HasBugBrokenVPCCidrs(meta MetadataClient) bool
HasBugBrokenVPCCidrs returns true if this instance has a known defective meta-data service which will not return secondary VPC CIDRs. As of January 2018, this covers c5 and m5 class hardware.
Types ¶
type AllocateClient ¶ added in v0.3.0
type AllocateClient interface { AllocateIPOn(intf Interface) (*AllocationResult, error) AllocateIPFirstAvailableAtIndex(index int) (*AllocationResult, error) AllocateIPFirstAvailable() (*AllocationResult, error) DeallocateIP(ipToRelease *net.IP) error }
AllocateClient offers IP allocation on interfaces
type AllocationResult ¶
AllocationResult contains a net.IP / Interface pair
func FindFreeIPsAtIndex ¶ added in v0.4.0
func FindFreeIPsAtIndex(index int, updateRegistry bool) ([]*AllocationResult, error)
FindFreeIPsAtIndex locates free IP addresses by comparing the assigned list from the EC2 metadata service and the currently used addresses within netlink. This is inherently somewhat racey - for example newly provisioned addresses may not show up immediately in metadata and are subject to a few seconds of delay.
type Bug ¶ added in v0.3.0
Bug defines a bug name and a function to check if the system is affected
func ListBugs ¶ added in v0.3.0
func ListBugs(meta MetadataClient) []Bug
ListBugs returns an enumerated set of all known bugs in AWS or instances that this instance is afflicted by
type Client ¶ added in v0.3.0
type Client interface { InterfaceClient LimitsClient MetadataClient SubnetsClient AllocateClient VPCClient }
Client offers all of the supporting AWS services
var DefaultClient Client
DefaultClient that is setup with known defaults
type ENILimit ¶
ENILimit contains limits for adapter count and addresses
func ENILimitsForInstanceType ¶
ENILimitsForInstanceType returns the limits for ENI for an instance type Returns a zero-limit for unknown instance types
type Interface ¶
type Interface struct { ID string Mac string IfName string Number int IPv4s []net.IP SubnetID string SubnetCidr *net.IPNet VpcID string VpcPrimaryCidr *net.IPNet VpcCidrs []*net.IPNet SecurityGroupIds []string }
Interface describes an interface from the metadata service
type InterfaceClient ¶ added in v0.3.0
type InterfaceClient interface { NewInterfaceOnSubnetAtIndex(index int, secGrps []string, subnet Subnet) (*Interface, error) NewInterface(secGrps []string, requiredTags map[string]string) (*Interface, error) RemoveInterface(interfaceIDs []string) error }
InterfaceClient provides methods for allocating and deallocating interfaces
type Interfaces ¶
type Interfaces []Interface
Interfaces contains a slice of Interface
func (Interfaces) Len ¶
func (a Interfaces) Len() int
func (Interfaces) Less ¶
func (a Interfaces) Less(i, j int) bool
func (Interfaces) Swap ¶
func (a Interfaces) Swap(i, j int)
type LimitsClient ¶ added in v0.3.0
type LimitsClient interface {
ENILimits() ENILimit
}
LimitsClient provides methods for locating limits in AWS
type MetadataClient ¶ added in v0.3.0
type MetadataClient interface { Available() bool GetInterfaces() ([]Interface, error) InstanceType() string }
MetadataClient provides methods to query the metadata service
type Registry ¶ added in v0.4.0
type Registry struct {
// contains filtered or unexported fields
}
Registry defines a re-usable IP registry which tracks IPs that are free in the system and when they were last released back to the pool.
type Subnet ¶
type Subnet struct { ID string Cidr string IsDefault bool AvailableAddressCount int Name string Tags map[string]string }
Subnet contains attributes of a subnet
type SubnetsByAvailableAddressCount ¶
type SubnetsByAvailableAddressCount []Subnet
SubnetsByAvailableAddressCount contains a list of subnet
func (SubnetsByAvailableAddressCount) Len ¶
func (a SubnetsByAvailableAddressCount) Len() int
func (SubnetsByAvailableAddressCount) Less ¶
func (a SubnetsByAvailableAddressCount) Less(i, j int) bool
func (SubnetsByAvailableAddressCount) Swap ¶
func (a SubnetsByAvailableAddressCount) Swap(i, j int)
type SubnetsClient ¶ added in v0.3.0
SubnetsClient provides information about VPC subnets