Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxRetries = 3 AppName = "amazon-vpc-resource-controller-k8s" SourceKey = "x-amz-source-arn" AccountKey = "x-amz-source-account" )
View Source
const (
CreateENIDescriptionPrefix = "aws-k8s-"
)
Variables ¶
View Source
var ( VpcCniAvailableClusterENICnt = prometheus.NewGauge( prometheus.GaugeOpts{ Name: "vpc_cni_created_available_eni_count", Help: "The number of available ENIs created by VPC-CNI that will tried to be deleted by the controller", }, ) VpcRcAvailableClusterENICnt = prometheus.NewGauge( prometheus.GaugeOpts{ Name: "vpc_rc_created_available_eni_count", Help: "The number of available ENIs created by VPC-RC that will tried to be deleted by the controller", }, ) LeakedENIClusterCleanupCnt = prometheus.NewGauge( prometheus.GaugeOpts{ Name: "leaked_eni_count", Help: "The number of available ENIs that failed to be deleted by the controller", }, ) NodeTerminationENICleanupFailure = prometheus.NewCounter( prometheus.CounterOpts{ Name: "node_termination_eni_cleanup_failures_total", Help: "Total number of ENI cleanup failures during node termination, tracked per cleanup attempt", }, ) )
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 []ec2types.Tag, ipResourceCount *config.IPResourceCount, interfaceType *string) (*ec2types.NetworkInterface, error) DeleteNetworkInterface(interfaceId *string) error GetSubnet(subnetId *string) (*ec2types.Subnet, error) GetBranchNetworkInterface(trunkID, subnetID *string) ([]*ec2types.NetworkInterface, error) GetInstanceNetworkInterface(instanceId *string) ([]ec2types.InstanceNetworkInterface, error) DescribeNetworkInterfaces(nwInterfaceIds []string) ([]ec2types.NetworkInterface, error) DescribeTrunkInterfaceAssociation(trunkInterfaceId *string) ([]ec2types.TrunkInterfaceAssociation, error) CreateAndAttachNetworkInterface(instanceId *string, subnetId *string, securityGroups []string, tags []ec2types.Tag, deviceIndex *int32, description *string, interfaceType *string, ipResourceCount *config.IPResourceCount) (*ec2types.NetworkInterface, error) AttachNetworkInterfaceToInstance(instanceId *string, nwInterfaceId *string, deviceIndex *int32) (*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) (*ec2types.Instance, error) AssignIPv4ResourcesAndWaitTillReady(eniID string, resourceType config.ResourceType, count int) ([]string, error) UnassignIPv4Resources(eniID string, resourceType config.ResourceType, resources []string) error DisassociateTrunkInterface(associationID *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(ctx context.Context, 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) DescribeNetworkInterfacesPages(ctx context.Context, input *ec2.DescribeNetworkInterfacesInput) ([]*ec2types.NetworkInterface, 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) DisassociateTrunkInterface(input *ec2.DisassociateTrunkInterfaceInput) error }
func NewEC2Wrapper ¶
func NewEC2Wrapper(roleARN, clusterName, region string, instanceClientQPS, instanceClientBurst, userClientQPS, userClientBurst int, 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.
Click to show internal directories.
Click to hide internal directories.