Documentation ¶
Index ¶
Constants ¶
View Source
const (
CreateENIDescriptionPrefix = "aws-k8s-"
)
View Source
const (
MaxRetries = 3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EC2APIHelper ¶
type EC2APIHelper interface { AssociateBranchToTrunk(trunkInterfaceId *string, branchInterfaceId *string, vlanId int) (*ec2.AssociateTrunkInterfaceOutput, error) CreateNetworkInterface(description *string, subnetId *string, securityGroups []string, tags []*ec2.Tag, secondaryPrivateIPCount int, interfaceType *string) (*ec2.NetworkInterface, error) DeleteNetworkInterface(interfaceId *string) error GetSubnet(subnetId *string) (*ec2.Subnet, error) GetBranchNetworkInterface(trunkID *string) ([]*ec2.NetworkInterface, error) GetInstanceNetworkInterface(instanceId *string) ([]*ec2.InstanceNetworkInterface, error) DescribeNetworkInterfaces(nwInterfaceIds []*string) ([]*ec2.NetworkInterface, error) DescribeTrunkInterfaceAssociation(trunkInterfaceId *string) ([]*ec2.TrunkInterfaceAssociation, error) CreateAndAttachNetworkInterface(instanceId *string, subnetId *string, securityGroups []string, tags []*ec2.Tag, deviceIndex *int64, description *string, interfaceType *string, secondaryIPCount int) (*ec2.NetworkInterface, error) AttachNetworkInterfaceToInstance(instanceId *string, nwInterfaceId *string, deviceIndex *int64) (*string, error) SetDeleteOnTermination(attachmentId *string, eniId *string) error DetachNetworkInterfaceFromInstance(attachmentId *string) error DetachAndDeleteNetworkInterface(attachmentId *string, nwInterfaceId *string) error WaitForNetworkInterfaceStatusChange(networkInterfaceId *string, desiredStatus string) error GetInstanceDetails(instanceId *string) (*ec2.Instance, error) AssignIPv4AddressesAndWaitTillReady(eniID string, count int) ([]string, error) UnassignPrivateIpAddresses(eniID string, ips []string) error }
func NewEC2APIHelper ¶
func NewEC2APIHelper(ec2Wrapper EC2Wrapper, clusterName string) EC2APIHelper
type EC2Wrapper ¶
type EC2Wrapper interface { DescribeInstances(input *ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error) CreateNetworkInterface(input *ec2.CreateNetworkInterfaceInput) (*ec2.CreateNetworkInterfaceOutput, error) AttachNetworkInterface(input *ec2.AttachNetworkInterfaceInput) (*ec2.AttachNetworkInterfaceOutput, error) DetachNetworkInterface(input *ec2.DetachNetworkInterfaceInput) (*ec2.DetachNetworkInterfaceOutput, error) DeleteNetworkInterface(input *ec2.DeleteNetworkInterfaceInput) (*ec2.DeleteNetworkInterfaceOutput, error) AssignPrivateIPAddresses(input *ec2.AssignPrivateIpAddressesInput) (*ec2.AssignPrivateIpAddressesOutput, error) UnassignPrivateIPAddresses(input *ec2.UnassignPrivateIpAddressesInput) (*ec2.UnassignPrivateIpAddressesOutput, error) DescribeNetworkInterfaces(input *ec2.DescribeNetworkInterfacesInput) (*ec2.DescribeNetworkInterfacesOutput, error) CreateTags(input *ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error) DescribeSubnets(input *ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error) AssociateTrunkInterface(input *ec2.AssociateTrunkInterfaceInput) (*ec2.AssociateTrunkInterfaceOutput, error) DescribeTrunkInterfaceAssociations(input *ec2.DescribeTrunkInterfaceAssociationsInput) (*ec2.DescribeTrunkInterfaceAssociationsOutput, error) ModifyNetworkInterfaceAttribute(input *ec2.ModifyNetworkInterfaceAttributeInput) (*ec2.ModifyNetworkInterfaceAttributeOutput, error) CreateNetworkInterfacePermission(input *ec2.CreateNetworkInterfacePermissionInput) (*ec2.CreateNetworkInterfacePermissionOutput, error) }
func NewEC2Wrapper ¶
func NewEC2Wrapper(roleARN string, log logr.Logger) (EC2Wrapper, error)
NewEC2Wrapper takes the roleARN that will be assumed to make all the EC2 API Calls, if no roleARN is passed then the ec2 client will be initialized with the instance's service role account.
type ENICleaner ¶
type ENICleaner struct {
// contains filtered or unexported fields
}
func NewENICleaner ¶
func NewENICleaner(ec2wrapper EC2Wrapper, clusterName string, ctx context.Context, log logr.Logger) *ENICleaner
NewENICleaner returns the ENICleaner
func (*ENICleaner) Start ¶
func (e *ENICleaner) Start(stop <-chan struct{}) error
StartENICleaner starts the ENI Cleaner routine that cleans up dangling ENIs created by the controller
Click to show internal directories.
Click to hide internal directories.