Documentation ¶
Index ¶
- Constants
- func GetSourceAccount(roleARN string) (string, error)
- func InstanceIDIndexFunc(obj interface{}) ([]string, error)
- func IsAWSErrorInstanceNotFound(err error) bool
- type Backoff
- type Cloud
- func (c *Cloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error
- func (c *Cloud) Clusters() (cloudprovider.Clusters, bool)
- func (c *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint string, ...) error
- func (c *Cloud) CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error)
- func (c *Cloud) DeleteRoute(ctx context.Context, clusterName string, route *cloudprovider.Route) error
- func (c *Cloud) EnsureLoadBalancer(ctx context.Context, clusterName string, apiService *v1.Service, ...) (*v1.LoadBalancerStatus, error)
- func (c *Cloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error
- func (c *Cloud) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
- func (c *Cloud) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string
- func (c *Cloud) GetZone(ctx context.Context) (cloudprovider.Zone, error)
- func (c *Cloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)
- func (c *Cloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)
- func (c *Cloud) HasClusterID() bool
- func (c *Cloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
- func (c *Cloud) InstanceExists(ctx context.Context, node *v1.Node) (bool, error)
- func (c *Cloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)
- func (c *Cloud) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error)
- func (c *Cloud) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovider.InstanceMetadata, error)
- func (c *Cloud) InstanceShutdown(ctx context.Context, node *v1.Node) (bool, error)
- func (c *Cloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
- func (c *Cloud) InstanceType(ctx context.Context, nodeName types.NodeName) (string, error)
- func (c *Cloud) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)
- func (c *Cloud) Instances() (cloudprovider.Instances, bool)
- func (c *Cloud) InstancesV2() (cloudprovider.InstancesV2, bool)
- func (c *Cloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudprovider.Route, error)
- func (c *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (c *Cloud) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error)
- func (c *Cloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
- func (c *Cloud) ProviderName() string
- func (c *Cloud) Routes() (cloudprovider.Routes, bool)
- func (c *Cloud) SetInformers(informerFactory informers.SharedInformerFactory)
- func (c *Cloud) TagResource(resourceID string, tags map[string]string) error
- func (c *Cloud) UntagResource(resourceID string, tags map[string]string) error
- func (c *Cloud) UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error
- func (c *Cloud) Zones() (cloudprovider.Zones, bool)
- type CrossRequestRetryDelay
- type ELB
- type ELBV2
- type FakeASG
- type FakeAWSServices
- func (s *FakeAWSServices) Compute(region string) (iface.EC2, error)
- func (s *FakeAWSServices) KeyManagement(region string) (KMS, error)
- func (s *FakeAWSServices) LoadBalancing(region string) (ELB, error)
- func (s *FakeAWSServices) LoadBalancingV2(region string) (ELBV2, error)
- func (s *FakeAWSServices) Metadata() (config.EC2Metadata, error)
- func (s *FakeAWSServices) WithAz(az string) *FakeAWSServices
- func (s *FakeAWSServices) WithRegion(region string) *FakeAWSServices
- type FakeEC2
- type FakeEC2Impl
- func (ec2i *FakeEC2Impl) AttachVolume(request *ec2.AttachVolumeInput) (resp *ec2.VolumeAttachment, err error)
- func (ec2i *FakeEC2Impl) AuthorizeSecurityGroupIngress(*ec2.AuthorizeSecurityGroupIngressInput) (*ec2.AuthorizeSecurityGroupIngressOutput, error)
- func (ec2i *FakeEC2Impl) CreateRoute(request *ec2.CreateRouteInput) (*ec2.CreateRouteOutput, error)
- func (ec2i *FakeEC2Impl) CreateRouteTable(request *ec2.RouteTable) (*ec2.CreateRouteTableOutput, error)
- func (ec2i *FakeEC2Impl) CreateSecurityGroup(*ec2.CreateSecurityGroupInput) (*ec2.CreateSecurityGroupOutput, error)
- func (ec2i *FakeEC2Impl) CreateSubnet(request *ec2.Subnet) (*ec2.CreateSubnetOutput, error)
- func (ec2i *FakeEC2Impl) CreateTags(input *ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error)
- func (ec2i *FakeEC2Impl) CreateVolume(request *ec2.CreateVolumeInput) (resp *ec2.Volume, err error)
- func (ec2i *FakeEC2Impl) DeleteRoute(request *ec2.DeleteRouteInput) (*ec2.DeleteRouteOutput, error)
- func (ec2i *FakeEC2Impl) DeleteSecurityGroup(*ec2.DeleteSecurityGroupInput) (*ec2.DeleteSecurityGroupOutput, error)
- func (ec2i *FakeEC2Impl) DeleteTags(input *ec2.DeleteTagsInput) (*ec2.DeleteTagsOutput, error)
- func (ec2i *FakeEC2Impl) DeleteVolume(request *ec2.DeleteVolumeInput) (resp *ec2.DeleteVolumeOutput, err error)
- func (ec2i *FakeEC2Impl) DescribeAvailabilityZones(request *ec2.DescribeAvailabilityZonesInput) ([]*ec2.AvailabilityZone, error)
- func (ec2i *FakeEC2Impl) DescribeInstances(request *ec2.DescribeInstancesInput) ([]*ec2.Instance, error)
- func (ec2i *FakeEC2Impl) DescribeNetworkInterfaces(input *ec2.DescribeNetworkInterfacesInput) (*ec2.DescribeNetworkInterfacesOutput, error)
- func (ec2i *FakeEC2Impl) DescribeRouteTables(request *ec2.DescribeRouteTablesInput) ([]*ec2.RouteTable, error)
- func (ec2i *FakeEC2Impl) DescribeSecurityGroups(request *ec2.DescribeSecurityGroupsInput) ([]*ec2.SecurityGroup, error)
- func (ec2i *FakeEC2Impl) DescribeSubnets(request *ec2.DescribeSubnetsInput) ([]*ec2.Subnet, error)
- func (ec2i *FakeEC2Impl) DescribeVolumeModifications(*ec2.DescribeVolumesModificationsInput) ([]*ec2.VolumeModification, error)
- func (ec2i *FakeEC2Impl) DescribeVolumes(request *ec2.DescribeVolumesInput) ([]*ec2.Volume, error)
- func (ec2i *FakeEC2Impl) DescribeVpcs(request *ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error)
- func (ec2i *FakeEC2Impl) DetachVolume(request *ec2.DetachVolumeInput) (resp *ec2.VolumeAttachment, err error)
- func (ec2i *FakeEC2Impl) ModifyInstanceAttribute(request *ec2.ModifyInstanceAttributeInput) (*ec2.ModifyInstanceAttributeOutput, error)
- func (ec2i *FakeEC2Impl) ModifyVolume(*ec2.ModifyVolumeInput) (*ec2.ModifyVolumeOutput, error)
- func (ec2i *FakeEC2Impl) RemoveRouteTables()
- func (ec2i *FakeEC2Impl) RemoveSubnets()
- func (ec2i *FakeEC2Impl) RevokeSecurityGroupIngress(*ec2.RevokeSecurityGroupIngressInput) (*ec2.RevokeSecurityGroupIngressOutput, error)
- type FakeELB
- func (e *FakeELB) AddTags(input *elb.AddTagsInput) (*elb.AddTagsOutput, error)
- func (e *FakeELB) ApplySecurityGroupsToLoadBalancer(*elb.ApplySecurityGroupsToLoadBalancerInput) (*elb.ApplySecurityGroupsToLoadBalancerOutput, error)
- func (e *FakeELB) AttachLoadBalancerToSubnets(*elb.AttachLoadBalancerToSubnetsInput) (*elb.AttachLoadBalancerToSubnetsOutput, error)
- func (e *FakeELB) ConfigureHealthCheck(*elb.ConfigureHealthCheckInput) (*elb.ConfigureHealthCheckOutput, error)
- func (e *FakeELB) CreateLoadBalancer(*elb.CreateLoadBalancerInput) (*elb.CreateLoadBalancerOutput, error)
- func (e *FakeELB) CreateLoadBalancerListeners(*elb.CreateLoadBalancerListenersInput) (*elb.CreateLoadBalancerListenersOutput, error)
- func (e *FakeELB) CreateLoadBalancerPolicy(*elb.CreateLoadBalancerPolicyInput) (*elb.CreateLoadBalancerPolicyOutput, error)
- func (e *FakeELB) DeleteLoadBalancer(input *elb.DeleteLoadBalancerInput) (*elb.DeleteLoadBalancerOutput, error)
- func (e *FakeELB) DeleteLoadBalancerListeners(*elb.DeleteLoadBalancerListenersInput) (*elb.DeleteLoadBalancerListenersOutput, error)
- func (e *FakeELB) DeregisterInstancesFromLoadBalancer(*elb.DeregisterInstancesFromLoadBalancerInput) (*elb.DeregisterInstancesFromLoadBalancerOutput, error)
- func (e *FakeELB) DescribeLoadBalancerAttributes(*elb.DescribeLoadBalancerAttributesInput) (*elb.DescribeLoadBalancerAttributesOutput, error)
- func (e *FakeELB) DescribeLoadBalancerPolicies(input *elb.DescribeLoadBalancerPoliciesInput) (*elb.DescribeLoadBalancerPoliciesOutput, error)
- func (e *FakeELB) DescribeLoadBalancers(input *elb.DescribeLoadBalancersInput) (*elb.DescribeLoadBalancersOutput, error)
- func (e *FakeELB) DetachLoadBalancerFromSubnets(*elb.DetachLoadBalancerFromSubnetsInput) (*elb.DetachLoadBalancerFromSubnetsOutput, error)
- func (e *FakeELB) ModifyLoadBalancerAttributes(*elb.ModifyLoadBalancerAttributesInput) (*elb.ModifyLoadBalancerAttributesOutput, error)
- func (e *FakeELB) RegisterInstancesWithLoadBalancer(*elb.RegisterInstancesWithLoadBalancerInput) (*elb.RegisterInstancesWithLoadBalancerOutput, error)
- func (e *FakeELB) SetLoadBalancerPoliciesForBackendServer(*elb.SetLoadBalancerPoliciesForBackendServerInput) (*elb.SetLoadBalancerPoliciesForBackendServerOutput, error)
- func (e *FakeELB) SetLoadBalancerPoliciesOfListener(input *elb.SetLoadBalancerPoliciesOfListenerInput) (*elb.SetLoadBalancerPoliciesOfListenerOutput, error)
- type FakeELBV2
- func (elb *FakeELBV2) AddTags(input *elbv2.AddTagsInput) (*elbv2.AddTagsOutput, error)
- func (elb *FakeELBV2) CreateListener(*elbv2.CreateListenerInput) (*elbv2.CreateListenerOutput, error)
- func (elb *FakeELBV2) CreateLoadBalancer(*elbv2.CreateLoadBalancerInput) (*elbv2.CreateLoadBalancerOutput, error)
- func (elb *FakeELBV2) CreateTargetGroup(*elbv2.CreateTargetGroupInput) (*elbv2.CreateTargetGroupOutput, error)
- func (elb *FakeELBV2) DeleteListener(*elbv2.DeleteListenerInput) (*elbv2.DeleteListenerOutput, error)
- func (elb *FakeELBV2) DeleteLoadBalancer(*elbv2.DeleteLoadBalancerInput) (*elbv2.DeleteLoadBalancerOutput, error)
- func (elb *FakeELBV2) DeleteTargetGroup(*elbv2.DeleteTargetGroupInput) (*elbv2.DeleteTargetGroupOutput, error)
- func (elb *FakeELBV2) DeregisterTargets(*elbv2.DeregisterTargetsInput) (*elbv2.DeregisterTargetsOutput, error)
- func (elb *FakeELBV2) DescribeListeners(*elbv2.DescribeListenersInput) (*elbv2.DescribeListenersOutput, error)
- func (elb *FakeELBV2) DescribeLoadBalancerAttributes(*elbv2.DescribeLoadBalancerAttributesInput) (*elbv2.DescribeLoadBalancerAttributesOutput, error)
- func (elb *FakeELBV2) DescribeLoadBalancers(*elbv2.DescribeLoadBalancersInput) (*elbv2.DescribeLoadBalancersOutput, error)
- func (elb *FakeELBV2) DescribeTargetGroupAttributes(*elbv2.DescribeTargetGroupAttributesInput) (*elbv2.DescribeTargetGroupAttributesOutput, error)
- func (elb *FakeELBV2) DescribeTargetGroups(*elbv2.DescribeTargetGroupsInput) (*elbv2.DescribeTargetGroupsOutput, error)
- func (elb *FakeELBV2) DescribeTargetHealth(input *elbv2.DescribeTargetHealthInput) (*elbv2.DescribeTargetHealthOutput, error)
- func (elb *FakeELBV2) ModifyListener(*elbv2.ModifyListenerInput) (*elbv2.ModifyListenerOutput, error)
- func (elb *FakeELBV2) ModifyLoadBalancerAttributes(*elbv2.ModifyLoadBalancerAttributesInput) (*elbv2.ModifyLoadBalancerAttributesOutput, error)
- func (elb *FakeELBV2) ModifyTargetGroup(*elbv2.ModifyTargetGroupInput) (*elbv2.ModifyTargetGroupOutput, error)
- func (elb *FakeELBV2) ModifyTargetGroupAttributes(*elbv2.ModifyTargetGroupAttributesInput) (*elbv2.ModifyTargetGroupAttributesOutput, error)
- func (elb *FakeELBV2) RegisterTargets(*elbv2.RegisterTargetsInput) (*elbv2.RegisterTargetsOutput, error)
- func (elb *FakeELBV2) WaitUntilLoadBalancersDeleted(*elbv2.DescribeLoadBalancersInput) error
- type FakeKMS
- type FakeMetadata
- type IPPermissionMatchDesc
- type IPPermissionNotMatch
- type IPPermissionPredicate
- type IPPermissionSet
- func (s IPPermissionSet) Delete(items ...*ec2.IpPermission)
- func (s IPPermissionSet) DeleteIf(predicate IPPermissionPredicate)
- func (s IPPermissionSet) Difference(s2 IPPermissionSet) IPPermissionSet
- func (s IPPermissionSet) Equal(s2 IPPermissionSet) bool
- func (s IPPermissionSet) Insert(items ...*ec2.IpPermission)
- func (s IPPermissionSet) IsSuperset(s2 IPPermissionSet) bool
- func (s IPPermissionSet) Len() int
- func (s IPPermissionSet) List() []*ec2.IpPermission
- func (s IPPermissionSet) Ungroup() IPPermissionSet
- type InstanceID
- type KMS
- type KubernetesInstanceID
- type ResourceLifecycle
- type Services
Constants ¶
const ( // ProxyProtocolPolicyName is the tag named used for the proxy protocol // policy ProxyProtocolPolicyName = "k8s-proxyprotocol-enabled" // SSLNegotiationPolicyNameFormat is a format string used for the SSL // negotiation policy tag name SSLNegotiationPolicyNameFormat = "k8s-SSLNegotiationPolicy-%s" )
const ( // ResourceLifecycleOwned is the value we use when tagging resources to indicate // that the resource is considered owned and managed by the cluster, // and in particular that the lifecycle is tied to the lifecycle of the cluster. ResourceLifecycleOwned = "owned" // that the resource is shared between multiple clusters, and should not be destroyed // if the cluster is destroyed. ResourceLifecycleShared = "shared" )
const ( // LabelZoneID is a topology label that can be applied to any resource // but will be initially applied to nodes. LabelZoneID = "topology.k8s.aws/zone-id" // LabelNetworkNodePrefix is a topology label that can be applied to any resource, // but will be initially applied to nodes. The suffix should be an incremented // integer starting at 1. LabelNetworkNodePrefix = "topology.k8s.aws/network-node-layer-" )
const MaxReadThenCreateRetries = 30
MaxReadThenCreateRetries sets the maximum number of attempts we will make when we read to see if something exists and then try to create it if we didn't find it. This can fail once in a consistent system if done in parallel In an eventually consistent system, it could fail unboundedly
const NLBClientRuleDescription = "kubernetes.io/rule/nlb/client"
NLBClientRuleDescription is the comment used on a security group rule to indicate that it is used for client traffic
const NLBHealthCheckRuleDescription = "kubernetes.io/rule/nlb/health"
NLBHealthCheckRuleDescription is the comment used on a security group rule to indicate that it is used for health checks
const NLBMtuDiscoveryRuleDescription = "kubernetes.io/rule/nlb/mtu"
NLBMtuDiscoveryRuleDescription is the comment used on a security group rule to indicate that it is used for mtu discovery
const ProviderName = "aws"
ProviderName is the name of this cloud provider.
const ServiceAnnotationLoadBalancerAccessLogEmitInterval = "service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval"
ServiceAnnotationLoadBalancerAccessLogEmitInterval is the annotation used to specify access log emit interval.
const ServiceAnnotationLoadBalancerAccessLogEnabled = "service.beta.kubernetes.io/aws-load-balancer-access-log-enabled"
ServiceAnnotationLoadBalancerAccessLogEnabled is the annotation used on the service to enable or disable access logs.
const ServiceAnnotationLoadBalancerAccessLogS3BucketName = "service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name"
ServiceAnnotationLoadBalancerAccessLogS3BucketName is the annotation used to specify access log s3 bucket name.
const ServiceAnnotationLoadBalancerAccessLogS3BucketPrefix = "service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix"
ServiceAnnotationLoadBalancerAccessLogS3BucketPrefix is the annotation used to specify access log s3 bucket prefix.
const ServiceAnnotationLoadBalancerAdditionalTags = "service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags"
ServiceAnnotationLoadBalancerAdditionalTags is the annotation used on the service to specify a comma-separated list of key-value pairs which will be recorded as additional tags in the ELB. For example: "Key1=Val1,Key2=Val2,KeyNoVal1=,KeyNoVal2"
const ServiceAnnotationLoadBalancerBEProtocol = "service.beta.kubernetes.io/aws-load-balancer-backend-protocol"
ServiceAnnotationLoadBalancerBEProtocol is the annotation used on the service to specify the protocol spoken by the backend (pod) behind a listener. If `http` (default) or `https`, an HTTPS listener that terminates the
connection and parses headers is created.
If set to `ssl` or `tcp`, a "raw" SSL listener is used. If set to `http` and `aws-load-balancer-ssl-cert` is not used then a HTTP listener is used.
const ServiceAnnotationLoadBalancerCertificate = "service.beta.kubernetes.io/aws-load-balancer-ssl-cert"
ServiceAnnotationLoadBalancerCertificate is the annotation used on the service to request a secure listener. Value is a valid certificate ARN. For more, see http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-listener-config.html CertARN is an IAM or CM certificate ARN, e.g. arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012
const ServiceAnnotationLoadBalancerConnectionDrainingEnabled = "service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled"
ServiceAnnotationLoadBalancerConnectionDrainingEnabled is the annnotation used on the service to enable or disable connection draining.
const ServiceAnnotationLoadBalancerConnectionDrainingTimeout = "service.beta.kubernetes.io/aws-load-balancer-connection-draining-timeout"
ServiceAnnotationLoadBalancerConnectionDrainingTimeout is the annotation used on the service to specify a connection draining timeout.
const ServiceAnnotationLoadBalancerConnectionIdleTimeout = "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout"
ServiceAnnotationLoadBalancerConnectionIdleTimeout is the annotation used on the service to specify the idle connection timeout.
const ServiceAnnotationLoadBalancerCrossZoneLoadBalancingEnabled = "service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled"
ServiceAnnotationLoadBalancerCrossZoneLoadBalancingEnabled is the annotation used on the service to enable or disable cross-zone load balancing.
const ServiceAnnotationLoadBalancerEIPAllocations = "service.beta.kubernetes.io/aws-load-balancer-eip-allocations"
ServiceAnnotationLoadBalancerEIPAllocations is the annotation used on the service to specify a comma separated list of EIP allocations to use as static IP addresses for the NLB. Only supported on elbv2 (NLB)
const ServiceAnnotationLoadBalancerExtraSecurityGroups = "service.beta.kubernetes.io/aws-load-balancer-extra-security-groups"
ServiceAnnotationLoadBalancerExtraSecurityGroups is the annotation used on the service to specify additional security groups to be added to ELB created
const ServiceAnnotationLoadBalancerHCHealthyThreshold = "service.beta.kubernetes.io/aws-load-balancer-healthcheck-healthy-threshold"
ServiceAnnotationLoadBalancerHCHealthyThreshold is the annotation used on the service to specify the number of successive successful health checks required for a backend to be considered healthy for traffic. For NLB, healthy-threshold and unhealthy-threshold must be equal.
const ServiceAnnotationLoadBalancerHCInterval = "service.beta.kubernetes.io/aws-load-balancer-healthcheck-interval"
ServiceAnnotationLoadBalancerHCInterval is the annotation used on the service to specify, in seconds, the interval between health checks.
const ServiceAnnotationLoadBalancerHCTimeout = "service.beta.kubernetes.io/aws-load-balancer-healthcheck-timeout"
ServiceAnnotationLoadBalancerHCTimeout is the annotation used on the service to specify, in seconds, how long to wait before marking a health check as failed.
const ServiceAnnotationLoadBalancerHCUnhealthyThreshold = "service.beta.kubernetes.io/aws-load-balancer-healthcheck-unhealthy-threshold"
ServiceAnnotationLoadBalancerHCUnhealthyThreshold is the annotation used on the service to specify the number of unsuccessful health checks required for a backend to be considered unhealthy for traffic
const ServiceAnnotationLoadBalancerHealthCheckPath = "service.beta.kubernetes.io/aws-load-balancer-healthcheck-path"
ServiceAnnotationLoadBalancerHealthCheckPath is the annotation used on the service to specify the path for the ELB health check when the health check protocol is HTTP/HTTPS Defaults to /healthz if externalTrafficPolicy is Local, / otherwise
const ServiceAnnotationLoadBalancerHealthCheckPort = "service.beta.kubernetes.io/aws-load-balancer-healthcheck-port"
ServiceAnnotationLoadBalancerHealthCheckPort is the annotation used on the service to specify the port used for ELB health check. Default is traffic-port if externalTrafficPolicy is Cluster, healthCheckNodePort if externalTrafficPolicy is Local
const ServiceAnnotationLoadBalancerHealthCheckProtocol = "service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol"
ServiceAnnotationLoadBalancerHealthCheckProtocol is the annotation used on the service to specify the protocol used for the ELB health check. Supported values are TCP, HTTP, HTTPS Default is TCP if externalTrafficPolicy is Cluster, HTTP if externalTrafficPolicy is Local
const ServiceAnnotationLoadBalancerInternal = "service.beta.kubernetes.io/aws-load-balancer-internal"
ServiceAnnotationLoadBalancerInternal is the annotation used on the service to indicate that we want an internal ELB.
const ServiceAnnotationLoadBalancerProxyProtocol = "service.beta.kubernetes.io/aws-load-balancer-proxy-protocol"
ServiceAnnotationLoadBalancerProxyProtocol is the annotation used on the service to enable the proxy protocol on an ELB. Right now we only accept the value "*" which means enable the proxy protocol on all ELB backends. In the future we could adjust this to allow setting the proxy protocol only on certain backends.
const ServiceAnnotationLoadBalancerSSLNegotiationPolicy = "service.beta.kubernetes.io/aws-load-balancer-ssl-negotiation-policy"
ServiceAnnotationLoadBalancerSSLNegotiationPolicy is the annotation used on the service to specify a SSL negotiation settings for the HTTPS/SSL listeners of your load balancer. Defaults to AWS's default
const ServiceAnnotationLoadBalancerSSLPorts = "service.beta.kubernetes.io/aws-load-balancer-ssl-ports"
ServiceAnnotationLoadBalancerSSLPorts is the annotation used on the service to specify a comma-separated list of ports that will use SSL/HTTPS listeners. Defaults to '*' (all).
const ServiceAnnotationLoadBalancerSecurityGroups = "service.beta.kubernetes.io/aws-load-balancer-security-groups"
ServiceAnnotationLoadBalancerSecurityGroups is the annotation used on the service to specify the security groups to be added to ELB created. Differently from the annotation "service.beta.kubernetes.io/aws-load-balancer-extra-security-groups", this replaces all other security groups previously assigned to the ELB.
const ServiceAnnotationLoadBalancerSubnets = "service.beta.kubernetes.io/aws-load-balancer-subnets"
ServiceAnnotationLoadBalancerSubnets is the annotation used on the service to specify the Availability Zone configuration for the load balancer. The values are comma separated list of subnetID or subnetName from different AZs By default, the controller will auto-discover the subnets. If there are multiple subnets per AZ, auto-discovery will break the tie in the following order -
- prefer the subnet with the correct role tag. kubernetes.io/role/elb for public and kubernetes.io/role/internal-elb for private access
- prefer the subnet with the cluster tag kubernetes.io/cluster/<Cluster Name>
- prefer the subnet that is first in lexicographic order
const ServiceAnnotationLoadBalancerTargetNodeLabels = "service.beta.kubernetes.io/aws-load-balancer-target-node-labels"
ServiceAnnotationLoadBalancerTargetNodeLabels is the annotation used on the service to specify a comma-separated list of key-value pairs which will be used to select the target nodes for the load balancer For example: "Key1=Val1,Key2=Val2,KeyNoVal1=,KeyNoVal2"
const ServiceAnnotationLoadBalancerType = "service.beta.kubernetes.io/aws-load-balancer-type"
ServiceAnnotationLoadBalancerType is the annotation used on the service to indicate what type of Load Balancer we want. Right now, the only accepted value is "nlb"
const TagNameKubernetesClusterLegacy = "KubernetesCluster"
TagNameKubernetesClusterLegacy is the legacy tag name we use to differentiate multiple logically independent clusters running in the same AZ. The problem with it was that it did not allow shared resources.
const TagNameKubernetesClusterPrefix = "kubernetes.io/cluster/"
TagNameKubernetesClusterPrefix is the tag name we use to differentiate multiple logically independent clusters running in the same AZ. The tag key = TagNameKubernetesClusterPrefix + clusterID The tag value is an ownership value
const TagNameKubernetesService = "kubernetes.io/service-name"
TagNameKubernetesService is the tag name we use to differentiate multiple services. Used currently for ELBs only.
const TagNameSubnetInternalELB = "kubernetes.io/role/internal-elb"
TagNameSubnetInternalELB is the tag name used on a subnet to designate that it should be used for internal ELBs
const TagNameSubnetPublicELB = "kubernetes.io/role/elb"
TagNameSubnetPublicELB is the tag name used on a subnet to designate that it should be used for internet ELBs
Variables ¶
This section is empty.
Functions ¶
func GetSourceAccount ¶ added in v1.23.18
GetSourceAccount constructs source acct and return them for use
func InstanceIDIndexFunc ¶ added in v1.23.0
InstanceIDIndexFunc indexes based on a Node's instance ID found in its spec.providerID
func IsAWSErrorInstanceNotFound ¶ added in v1.23.19
IsAWSErrorInstanceNotFound returns true if the specified error is an awserr.Error with the code `InvalidInstanceId.NotFound`.
Types ¶
type Backoff ¶
type Backoff struct {
// contains filtered or unexported fields
}
Backoff manages a backoff that varies based on the recently observed failures
func (*Backoff) ComputeDelayForRequest ¶
ComputeDelayForRequest computes the delay required for a request, also updates internal state to count this request
func (*Backoff) ReportError ¶
func (b *Backoff) ReportError()
ReportError is called when we observe a throttling error
type Cloud ¶
type Cloud struct {
// contains filtered or unexported fields
}
Cloud is an implementation of Interface, LoadBalancer and Instances for Amazon Web Services.
func NewAWSCloud ¶
func NewAWSCloud(cfg config.CloudConfig, awsServices Services) (*Cloud, error)
NewAWSCloud calls and return new aws cloud from newAWSCloud with the supplied configuration
func (*Cloud) AddSSHKeyToAllInstances ¶
AddSSHKeyToAllInstances is currently not implemented.
func (*Cloud) Clusters ¶
func (c *Cloud) Clusters() (cloudprovider.Clusters, bool)
Clusters returns the list of clusters.
func (*Cloud) CreateRoute ¶
func (c *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint string, route *cloudprovider.Route) error
CreateRoute implements Routes.CreateRoute Create the described route
func (*Cloud) CurrentNodeName ¶
CurrentNodeName returns the name of the current node
func (*Cloud) DeleteRoute ¶
func (c *Cloud) DeleteRoute(ctx context.Context, clusterName string, route *cloudprovider.Route) error
DeleteRoute implements Routes.DeleteRoute Delete the specified route
func (*Cloud) EnsureLoadBalancer ¶
func (c *Cloud) EnsureLoadBalancer(ctx context.Context, clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
EnsureLoadBalancer implements LoadBalancer.EnsureLoadBalancer
func (*Cloud) EnsureLoadBalancerDeleted ¶
func (c *Cloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error
EnsureLoadBalancerDeleted implements LoadBalancer.EnsureLoadBalancerDeleted.
func (*Cloud) GetLoadBalancer ¶
func (c *Cloud) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
GetLoadBalancer is an implementation of LoadBalancer.GetLoadBalancer
func (*Cloud) GetLoadBalancerName ¶
func (c *Cloud) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string
GetLoadBalancerName is an implementation of LoadBalancer.GetLoadBalancerName
func (*Cloud) GetZoneByNodeName ¶
func (c *Cloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)
GetZoneByNodeName implements Zones.GetZoneByNodeName This is particularly useful in external cloud providers where the kubelet does not initialize node data.
func (*Cloud) GetZoneByProviderID ¶
func (c *Cloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)
GetZoneByProviderID implements Zones.GetZoneByProviderID This is particularly useful in external cloud providers where the kubelet does not initialize node data.
func (*Cloud) HasClusterID ¶
HasClusterID returns true if the cluster has a clusterID
func (*Cloud) Initialize ¶
func (c *Cloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})
Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func (*Cloud) InstanceExists ¶ added in v1.30.0
InstanceExists returns true if the instance for the given node exists according to the cloud provider. Use the node.name or node.spec.providerID field to find the node in the cloud provider.
func (*Cloud) InstanceExistsByProviderID ¶
InstanceExistsByProviderID returns true if the instance with the given provider id still exists. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func (*Cloud) InstanceID ¶
InstanceID returns the cloud provider ID of the node with the specified nodeName.
func (*Cloud) InstanceMetadata ¶ added in v1.30.0
func (c *Cloud) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovider.InstanceMetadata, error)
InstanceMetadata returns the instance's metadata. The values returned in InstanceMetadata are translated into specific fields and labels in the Node object on registration. Implementations should always check node.spec.providerID first when trying to discover the instance for a given node. In cases where node.spec.providerID is empty, implementations can use other properties of the node like its name, labels and annotations.
func (*Cloud) InstanceShutdown ¶ added in v1.30.0
InstanceShutdown returns true if the instance is shutdown according to the cloud provider. Use the node.name or node.spec.providerID field to find the node in the cloud provider.
func (*Cloud) InstanceShutdownByProviderID ¶
InstanceShutdownByProviderID returns true if the instance is terminated
func (*Cloud) InstanceType ¶
InstanceType returns the type of the node with the specified nodeName.
func (*Cloud) InstanceTypeByProviderID ¶
InstanceTypeByProviderID returns the cloudprovider instance type of the node with the specified unique providerID This method will not be called from the node that is requesting this ID. i.e. metadata service and other local methods cannot be used here
func (*Cloud) Instances ¶
func (c *Cloud) Instances() (cloudprovider.Instances, bool)
Instances returns an implementation of Instances for Amazon Web Services.
func (*Cloud) InstancesV2 ¶
func (c *Cloud) InstancesV2() (cloudprovider.InstancesV2, bool)
InstancesV2 returns an implementation of InstancesV2 for Amazon Web Services.
func (*Cloud) ListRoutes ¶
ListRoutes implements Routes.ListRoutes List all routes that match the filter
func (*Cloud) LoadBalancer ¶
func (c *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns an implementation of LoadBalancer for Amazon Web Services.
func (*Cloud) NodeAddresses ¶
NodeAddresses is an implementation of Instances.NodeAddresses.
func (*Cloud) NodeAddressesByProviderID ¶
func (c *Cloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
NodeAddressesByProviderID returns the node addresses of an instances with the specified unique providerID This method will not be called from the node that is requesting this ID. i.e. metadata service and other local methods cannot be used here
func (*Cloud) ProviderName ¶
ProviderName returns the cloud provider ID.
func (*Cloud) Routes ¶
func (c *Cloud) Routes() (cloudprovider.Routes, bool)
Routes returns an implementation of Routes for Amazon Web Services.
func (*Cloud) SetInformers ¶
func (c *Cloud) SetInformers(informerFactory informers.SharedInformerFactory)
SetInformers implements InformerUser interface by setting up informer-fed caches for aws lib to leverage Kubernetes API for caching
func (*Cloud) TagResource ¶
TagResource calls EC2 and tag the resource associated to resourceID with the supplied tags
func (*Cloud) UntagResource ¶
UntagResource calls EC2 and tag the resource associated to resourceID with the supplied tags
type CrossRequestRetryDelay ¶
type CrossRequestRetryDelay struct {
// contains filtered or unexported fields
}
CrossRequestRetryDelay inserts delays before AWS calls, when we are observing RequestLimitExceeded errors Note that we share a CrossRequestRetryDelay across multiple AWS requests; this is a process-wide back-off, whereas the aws-sdk-go implements a per-request exponential backoff/retry
func NewCrossRequestRetryDelay ¶
func NewCrossRequestRetryDelay() *CrossRequestRetryDelay
NewCrossRequestRetryDelay creates a new CrossRequestRetryDelay
func (*CrossRequestRetryDelay) AfterRetry ¶
func (c *CrossRequestRetryDelay) AfterRetry(r *request.Request)
AfterRetry is added to the AfterRetry chain; called after any error
func (*CrossRequestRetryDelay) BeforeSign ¶
func (c *CrossRequestRetryDelay) BeforeSign(r *request.Request)
BeforeSign is added to the Sign chain; called before each request
type ELB ¶
type ELB interface { CreateLoadBalancer(*elb.CreateLoadBalancerInput) (*elb.CreateLoadBalancerOutput, error) DeleteLoadBalancer(*elb.DeleteLoadBalancerInput) (*elb.DeleteLoadBalancerOutput, error) DescribeLoadBalancers(*elb.DescribeLoadBalancersInput) (*elb.DescribeLoadBalancersOutput, error) AddTags(*elb.AddTagsInput) (*elb.AddTagsOutput, error) RegisterInstancesWithLoadBalancer(*elb.RegisterInstancesWithLoadBalancerInput) (*elb.RegisterInstancesWithLoadBalancerOutput, error) DeregisterInstancesFromLoadBalancer(*elb.DeregisterInstancesFromLoadBalancerInput) (*elb.DeregisterInstancesFromLoadBalancerOutput, error) CreateLoadBalancerPolicy(*elb.CreateLoadBalancerPolicyInput) (*elb.CreateLoadBalancerPolicyOutput, error) SetLoadBalancerPoliciesForBackendServer(*elb.SetLoadBalancerPoliciesForBackendServerInput) (*elb.SetLoadBalancerPoliciesForBackendServerOutput, error) SetLoadBalancerPoliciesOfListener(input *elb.SetLoadBalancerPoliciesOfListenerInput) (*elb.SetLoadBalancerPoliciesOfListenerOutput, error) DescribeLoadBalancerPolicies(input *elb.DescribeLoadBalancerPoliciesInput) (*elb.DescribeLoadBalancerPoliciesOutput, error) DetachLoadBalancerFromSubnets(*elb.DetachLoadBalancerFromSubnetsInput) (*elb.DetachLoadBalancerFromSubnetsOutput, error) AttachLoadBalancerToSubnets(*elb.AttachLoadBalancerToSubnetsInput) (*elb.AttachLoadBalancerToSubnetsOutput, error) CreateLoadBalancerListeners(*elb.CreateLoadBalancerListenersInput) (*elb.CreateLoadBalancerListenersOutput, error) DeleteLoadBalancerListeners(*elb.DeleteLoadBalancerListenersInput) (*elb.DeleteLoadBalancerListenersOutput, error) ApplySecurityGroupsToLoadBalancer(*elb.ApplySecurityGroupsToLoadBalancerInput) (*elb.ApplySecurityGroupsToLoadBalancerOutput, error) ConfigureHealthCheck(*elb.ConfigureHealthCheckInput) (*elb.ConfigureHealthCheckOutput, error) DescribeLoadBalancerAttributes(*elb.DescribeLoadBalancerAttributesInput) (*elb.DescribeLoadBalancerAttributesOutput, error) ModifyLoadBalancerAttributes(*elb.ModifyLoadBalancerAttributesInput) (*elb.ModifyLoadBalancerAttributesOutput, error) }
ELB is a simple pass-through of AWS' ELB client interface, which allows for testing
type ELBV2 ¶
type ELBV2 interface { AddTags(input *elbv2.AddTagsInput) (*elbv2.AddTagsOutput, error) CreateLoadBalancer(*elbv2.CreateLoadBalancerInput) (*elbv2.CreateLoadBalancerOutput, error) DescribeLoadBalancers(*elbv2.DescribeLoadBalancersInput) (*elbv2.DescribeLoadBalancersOutput, error) DeleteLoadBalancer(*elbv2.DeleteLoadBalancerInput) (*elbv2.DeleteLoadBalancerOutput, error) ModifyLoadBalancerAttributes(*elbv2.ModifyLoadBalancerAttributesInput) (*elbv2.ModifyLoadBalancerAttributesOutput, error) DescribeLoadBalancerAttributes(*elbv2.DescribeLoadBalancerAttributesInput) (*elbv2.DescribeLoadBalancerAttributesOutput, error) CreateTargetGroup(*elbv2.CreateTargetGroupInput) (*elbv2.CreateTargetGroupOutput, error) DescribeTargetGroups(*elbv2.DescribeTargetGroupsInput) (*elbv2.DescribeTargetGroupsOutput, error) ModifyTargetGroup(*elbv2.ModifyTargetGroupInput) (*elbv2.ModifyTargetGroupOutput, error) DeleteTargetGroup(*elbv2.DeleteTargetGroupInput) (*elbv2.DeleteTargetGroupOutput, error) DescribeTargetHealth(input *elbv2.DescribeTargetHealthInput) (*elbv2.DescribeTargetHealthOutput, error) DescribeTargetGroupAttributes(*elbv2.DescribeTargetGroupAttributesInput) (*elbv2.DescribeTargetGroupAttributesOutput, error) ModifyTargetGroupAttributes(*elbv2.ModifyTargetGroupAttributesInput) (*elbv2.ModifyTargetGroupAttributesOutput, error) RegisterTargets(*elbv2.RegisterTargetsInput) (*elbv2.RegisterTargetsOutput, error) DeregisterTargets(*elbv2.DeregisterTargetsInput) (*elbv2.DeregisterTargetsOutput, error) CreateListener(*elbv2.CreateListenerInput) (*elbv2.CreateListenerOutput, error) DescribeListeners(*elbv2.DescribeListenersInput) (*elbv2.DescribeListenersOutput, error) DeleteListener(*elbv2.DeleteListenerInput) (*elbv2.DeleteListenerOutput, error) ModifyListener(*elbv2.ModifyListenerInput) (*elbv2.ModifyListenerOutput, error) WaitUntilLoadBalancersDeleted(*elbv2.DescribeLoadBalancersInput) error }
ELBV2 is a simple pass-through of AWS' ELBV2 client interface, which allows for testing
type FakeASG ¶
type FakeASG struct {
// contains filtered or unexported fields
}
FakeASG is a fake Autoscaling client used for testing
func (*FakeASG) DescribeAutoScalingGroups ¶
func (a *FakeASG) DescribeAutoScalingGroups(*autoscaling.DescribeAutoScalingGroupsInput) (*autoscaling.DescribeAutoScalingGroupsOutput, error)
DescribeAutoScalingGroups is not implemented but is required for interface conformance
func (*FakeASG) UpdateAutoScalingGroup ¶
func (a *FakeASG) UpdateAutoScalingGroup(*autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error)
UpdateAutoScalingGroup is not implemented but is required for interface conformance
type FakeAWSServices ¶
type FakeAWSServices struct {
// contains filtered or unexported fields
}
FakeAWSServices is an fake AWS session used for testing
func NewFakeAWSServices ¶
func NewFakeAWSServices(clusterID string) *FakeAWSServices
NewFakeAWSServices creates a new FakeAWSServices
func (*FakeAWSServices) Compute ¶
func (s *FakeAWSServices) Compute(region string) (iface.EC2, error)
Compute returns a fake EC2 client
func (*FakeAWSServices) KeyManagement ¶
func (s *FakeAWSServices) KeyManagement(region string) (KMS, error)
KeyManagement returns a fake KMS client
func (*FakeAWSServices) LoadBalancing ¶
func (s *FakeAWSServices) LoadBalancing(region string) (ELB, error)
LoadBalancing returns a fake ELB client
func (*FakeAWSServices) LoadBalancingV2 ¶
func (s *FakeAWSServices) LoadBalancingV2(region string) (ELBV2, error)
LoadBalancingV2 returns a fake ELBV2 client
func (*FakeAWSServices) Metadata ¶
func (s *FakeAWSServices) Metadata() (config.EC2Metadata, error)
Metadata returns a fake EC2Metadata client
func (*FakeAWSServices) WithAz ¶
func (s *FakeAWSServices) WithAz(az string) *FakeAWSServices
WithAz sets the ec2 placement availability zone
func (*FakeAWSServices) WithRegion ¶ added in v1.23.19
func (s *FakeAWSServices) WithRegion(region string) *FakeAWSServices
WithRegion sets the AWS region
type FakeEC2 ¶
type FakeEC2 interface { iface.EC2 CreateSubnet(*ec2.Subnet) (*ec2.CreateSubnetOutput, error) RemoveSubnets() CreateRouteTable(*ec2.RouteTable) (*ec2.CreateRouteTableOutput, error) RemoveRouteTables() }
FakeEC2 is a fake EC2 client used for testing
type FakeEC2Impl ¶
type FakeEC2Impl struct { Subnets []*ec2.Subnet DescribeSubnetsInput *ec2.DescribeSubnetsInput RouteTables []*ec2.RouteTable DescribeRouteTablesInput *ec2.DescribeRouteTablesInput // contains filtered or unexported fields }
FakeEC2Impl is an implementation of the FakeEC2 interface used for testing
func (*FakeEC2Impl) AttachVolume ¶
func (ec2i *FakeEC2Impl) AttachVolume(request *ec2.AttachVolumeInput) (resp *ec2.VolumeAttachment, err error)
AttachVolume is not implemented but is required for interface conformance
func (*FakeEC2Impl) AuthorizeSecurityGroupIngress ¶
func (ec2i *FakeEC2Impl) AuthorizeSecurityGroupIngress(*ec2.AuthorizeSecurityGroupIngressInput) (*ec2.AuthorizeSecurityGroupIngressOutput, error)
AuthorizeSecurityGroupIngress is not implemented but is required for interface conformance
func (*FakeEC2Impl) CreateRoute ¶
func (ec2i *FakeEC2Impl) CreateRoute(request *ec2.CreateRouteInput) (*ec2.CreateRouteOutput, error)
CreateRoute is not implemented but is required for interface conformance
func (*FakeEC2Impl) CreateRouteTable ¶
func (ec2i *FakeEC2Impl) CreateRouteTable(request *ec2.RouteTable) (*ec2.CreateRouteTableOutput, error)
CreateRouteTable creates fake route tables
func (*FakeEC2Impl) CreateSecurityGroup ¶
func (ec2i *FakeEC2Impl) CreateSecurityGroup(*ec2.CreateSecurityGroupInput) (*ec2.CreateSecurityGroupOutput, error)
CreateSecurityGroup is not implemented but is required for interface conformance
func (*FakeEC2Impl) CreateSubnet ¶
func (ec2i *FakeEC2Impl) CreateSubnet(request *ec2.Subnet) (*ec2.CreateSubnetOutput, error)
CreateSubnet creates fake subnets
func (*FakeEC2Impl) CreateTags ¶
func (ec2i *FakeEC2Impl) CreateTags(input *ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error)
CreateTags is a mock for CreateTags from EC2
func (*FakeEC2Impl) CreateVolume ¶
func (ec2i *FakeEC2Impl) CreateVolume(request *ec2.CreateVolumeInput) (resp *ec2.Volume, err error)
CreateVolume is not implemented but is required for interface conformance
func (*FakeEC2Impl) DeleteRoute ¶
func (ec2i *FakeEC2Impl) DeleteRoute(request *ec2.DeleteRouteInput) (*ec2.DeleteRouteOutput, error)
DeleteRoute is not implemented but is required for interface conformance
func (*FakeEC2Impl) DeleteSecurityGroup ¶
func (ec2i *FakeEC2Impl) DeleteSecurityGroup(*ec2.DeleteSecurityGroupInput) (*ec2.DeleteSecurityGroupOutput, error)
DeleteSecurityGroup is not implemented but is required for interface conformance
func (*FakeEC2Impl) DeleteTags ¶
func (ec2i *FakeEC2Impl) DeleteTags(input *ec2.DeleteTagsInput) (*ec2.DeleteTagsOutput, error)
DeleteTags is a mock for DeleteTags from EC2
func (*FakeEC2Impl) DeleteVolume ¶
func (ec2i *FakeEC2Impl) DeleteVolume(request *ec2.DeleteVolumeInput) (resp *ec2.DeleteVolumeOutput, err error)
DeleteVolume is not implemented but is required for interface conformance
func (*FakeEC2Impl) DescribeAvailabilityZones ¶ added in v1.26.1
func (ec2i *FakeEC2Impl) DescribeAvailabilityZones(request *ec2.DescribeAvailabilityZonesInput) ([]*ec2.AvailabilityZone, error)
DescribeAvailabilityZones returns fake availability zones For every input returns a hardcoded list of fake availability zones for the moment
func (*FakeEC2Impl) DescribeInstances ¶
func (ec2i *FakeEC2Impl) DescribeInstances(request *ec2.DescribeInstancesInput) ([]*ec2.Instance, error)
DescribeInstances returns fake instance descriptions
func (*FakeEC2Impl) DescribeNetworkInterfaces ¶ added in v1.20.2
func (ec2i *FakeEC2Impl) DescribeNetworkInterfaces(input *ec2.DescribeNetworkInterfacesInput) (*ec2.DescribeNetworkInterfacesOutput, error)
DescribeNetworkInterfaces returns list of ENIs for testing
func (*FakeEC2Impl) DescribeRouteTables ¶
func (ec2i *FakeEC2Impl) DescribeRouteTables(request *ec2.DescribeRouteTablesInput) ([]*ec2.RouteTable, error)
DescribeRouteTables returns fake route table descriptions
func (*FakeEC2Impl) DescribeSecurityGroups ¶
func (ec2i *FakeEC2Impl) DescribeSecurityGroups(request *ec2.DescribeSecurityGroupsInput) ([]*ec2.SecurityGroup, error)
DescribeSecurityGroups is not implemented but is required for interface conformance
func (*FakeEC2Impl) DescribeSubnets ¶
func (ec2i *FakeEC2Impl) DescribeSubnets(request *ec2.DescribeSubnetsInput) ([]*ec2.Subnet, error)
DescribeSubnets returns fake subnet descriptions
func (*FakeEC2Impl) DescribeVolumeModifications ¶
func (ec2i *FakeEC2Impl) DescribeVolumeModifications(*ec2.DescribeVolumesModificationsInput) ([]*ec2.VolumeModification, error)
DescribeVolumeModifications is not implemented but is required for interface conformance
func (*FakeEC2Impl) DescribeVolumes ¶
func (ec2i *FakeEC2Impl) DescribeVolumes(request *ec2.DescribeVolumesInput) ([]*ec2.Volume, error)
DescribeVolumes is not implemented but is required for interface conformance
func (*FakeEC2Impl) DescribeVpcs ¶
func (ec2i *FakeEC2Impl) DescribeVpcs(request *ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error)
DescribeVpcs returns fake VPC descriptions
func (*FakeEC2Impl) DetachVolume ¶
func (ec2i *FakeEC2Impl) DetachVolume(request *ec2.DetachVolumeInput) (resp *ec2.VolumeAttachment, err error)
DetachVolume is not implemented but is required for interface conformance
func (*FakeEC2Impl) ModifyInstanceAttribute ¶
func (ec2i *FakeEC2Impl) ModifyInstanceAttribute(request *ec2.ModifyInstanceAttributeInput) (*ec2.ModifyInstanceAttributeOutput, error)
ModifyInstanceAttribute is not implemented but is required for interface conformance
func (*FakeEC2Impl) ModifyVolume ¶
func (ec2i *FakeEC2Impl) ModifyVolume(*ec2.ModifyVolumeInput) (*ec2.ModifyVolumeOutput, error)
ModifyVolume is not implemented but is required for interface conformance
func (*FakeEC2Impl) RemoveRouteTables ¶
func (ec2i *FakeEC2Impl) RemoveRouteTables()
RemoveRouteTables clears route tables on client
func (*FakeEC2Impl) RemoveSubnets ¶
func (ec2i *FakeEC2Impl) RemoveSubnets()
RemoveSubnets clears subnets on client
func (*FakeEC2Impl) RevokeSecurityGroupIngress ¶
func (ec2i *FakeEC2Impl) RevokeSecurityGroupIngress(*ec2.RevokeSecurityGroupIngressInput) (*ec2.RevokeSecurityGroupIngressOutput, error)
RevokeSecurityGroupIngress is not implemented but is required for interface conformance
type FakeELB ¶
type FakeELB struct {
// contains filtered or unexported fields
}
FakeELB is a fake ELB client used for testing
func (*FakeELB) AddTags ¶
func (e *FakeELB) AddTags(input *elb.AddTagsInput) (*elb.AddTagsOutput, error)
AddTags is not implemented but is required for interface conformance
func (*FakeELB) ApplySecurityGroupsToLoadBalancer ¶
func (e *FakeELB) ApplySecurityGroupsToLoadBalancer(*elb.ApplySecurityGroupsToLoadBalancerInput) (*elb.ApplySecurityGroupsToLoadBalancerOutput, error)
ApplySecurityGroupsToLoadBalancer is not implemented but is required for interface conformance
func (*FakeELB) AttachLoadBalancerToSubnets ¶
func (e *FakeELB) AttachLoadBalancerToSubnets(*elb.AttachLoadBalancerToSubnetsInput) (*elb.AttachLoadBalancerToSubnetsOutput, error)
AttachLoadBalancerToSubnets is not implemented but is required for interface conformance
func (*FakeELB) ConfigureHealthCheck ¶
func (e *FakeELB) ConfigureHealthCheck(*elb.ConfigureHealthCheckInput) (*elb.ConfigureHealthCheckOutput, error)
ConfigureHealthCheck is not implemented but is required for interface conformance
func (*FakeELB) CreateLoadBalancer ¶
func (e *FakeELB) CreateLoadBalancer(*elb.CreateLoadBalancerInput) (*elb.CreateLoadBalancerOutput, error)
CreateLoadBalancer is not implemented but is required for interface conformance
func (*FakeELB) CreateLoadBalancerListeners ¶
func (e *FakeELB) CreateLoadBalancerListeners(*elb.CreateLoadBalancerListenersInput) (*elb.CreateLoadBalancerListenersOutput, error)
CreateLoadBalancerListeners is not implemented but is required for interface conformance
func (*FakeELB) CreateLoadBalancerPolicy ¶
func (e *FakeELB) CreateLoadBalancerPolicy(*elb.CreateLoadBalancerPolicyInput) (*elb.CreateLoadBalancerPolicyOutput, error)
CreateLoadBalancerPolicy is not implemented but is required for interface conformance
func (*FakeELB) DeleteLoadBalancer ¶
func (e *FakeELB) DeleteLoadBalancer(input *elb.DeleteLoadBalancerInput) (*elb.DeleteLoadBalancerOutput, error)
DeleteLoadBalancer is not implemented but is required for interface conformance
func (*FakeELB) DeleteLoadBalancerListeners ¶
func (e *FakeELB) DeleteLoadBalancerListeners(*elb.DeleteLoadBalancerListenersInput) (*elb.DeleteLoadBalancerListenersOutput, error)
DeleteLoadBalancerListeners is not implemented but is required for interface conformance
func (*FakeELB) DeregisterInstancesFromLoadBalancer ¶
func (e *FakeELB) DeregisterInstancesFromLoadBalancer(*elb.DeregisterInstancesFromLoadBalancerInput) (*elb.DeregisterInstancesFromLoadBalancerOutput, error)
DeregisterInstancesFromLoadBalancer is not implemented but is required for interface conformance
func (*FakeELB) DescribeLoadBalancerAttributes ¶
func (e *FakeELB) DescribeLoadBalancerAttributes(*elb.DescribeLoadBalancerAttributesInput) (*elb.DescribeLoadBalancerAttributesOutput, error)
DescribeLoadBalancerAttributes is not implemented but is required for interface conformance
func (*FakeELB) DescribeLoadBalancerPolicies ¶
func (e *FakeELB) DescribeLoadBalancerPolicies(input *elb.DescribeLoadBalancerPoliciesInput) (*elb.DescribeLoadBalancerPoliciesOutput, error)
DescribeLoadBalancerPolicies is not implemented but is required for interface conformance
func (*FakeELB) DescribeLoadBalancers ¶
func (e *FakeELB) DescribeLoadBalancers(input *elb.DescribeLoadBalancersInput) (*elb.DescribeLoadBalancersOutput, error)
DescribeLoadBalancers is not implemented but is required for interface conformance
func (*FakeELB) DetachLoadBalancerFromSubnets ¶
func (e *FakeELB) DetachLoadBalancerFromSubnets(*elb.DetachLoadBalancerFromSubnetsInput) (*elb.DetachLoadBalancerFromSubnetsOutput, error)
DetachLoadBalancerFromSubnets is not implemented but is required for interface conformance
func (*FakeELB) ModifyLoadBalancerAttributes ¶
func (e *FakeELB) ModifyLoadBalancerAttributes(*elb.ModifyLoadBalancerAttributesInput) (*elb.ModifyLoadBalancerAttributesOutput, error)
ModifyLoadBalancerAttributes is not implemented but is required for interface conformance
func (*FakeELB) RegisterInstancesWithLoadBalancer ¶
func (e *FakeELB) RegisterInstancesWithLoadBalancer(*elb.RegisterInstancesWithLoadBalancerInput) (*elb.RegisterInstancesWithLoadBalancerOutput, error)
RegisterInstancesWithLoadBalancer is not implemented but is required for interface conformance
func (*FakeELB) SetLoadBalancerPoliciesForBackendServer ¶
func (e *FakeELB) SetLoadBalancerPoliciesForBackendServer(*elb.SetLoadBalancerPoliciesForBackendServerInput) (*elb.SetLoadBalancerPoliciesForBackendServerOutput, error)
SetLoadBalancerPoliciesForBackendServer is not implemented but is required for interface conformance
func (*FakeELB) SetLoadBalancerPoliciesOfListener ¶
func (e *FakeELB) SetLoadBalancerPoliciesOfListener(input *elb.SetLoadBalancerPoliciesOfListenerInput) (*elb.SetLoadBalancerPoliciesOfListenerOutput, error)
SetLoadBalancerPoliciesOfListener is not implemented but is required for interface conformance
type FakeELBV2 ¶
type FakeELBV2 struct {
// contains filtered or unexported fields
}
FakeELBV2 is a fake ELBV2 client used for testing
func (*FakeELBV2) AddTags ¶
func (elb *FakeELBV2) AddTags(input *elbv2.AddTagsInput) (*elbv2.AddTagsOutput, error)
AddTags is not implemented but is required for interface conformance
func (*FakeELBV2) CreateListener ¶
func (elb *FakeELBV2) CreateListener(*elbv2.CreateListenerInput) (*elbv2.CreateListenerOutput, error)
CreateListener is not implemented but is required for interface conformance
func (*FakeELBV2) CreateLoadBalancer ¶
func (elb *FakeELBV2) CreateLoadBalancer(*elbv2.CreateLoadBalancerInput) (*elbv2.CreateLoadBalancerOutput, error)
CreateLoadBalancer is not implemented but is required for interface conformance
func (*FakeELBV2) CreateTargetGroup ¶
func (elb *FakeELBV2) CreateTargetGroup(*elbv2.CreateTargetGroupInput) (*elbv2.CreateTargetGroupOutput, error)
CreateTargetGroup is not implemented but is required for interface conformance
func (*FakeELBV2) DeleteListener ¶
func (elb *FakeELBV2) DeleteListener(*elbv2.DeleteListenerInput) (*elbv2.DeleteListenerOutput, error)
DeleteListener is not implemented but is required for interface conformance
func (*FakeELBV2) DeleteLoadBalancer ¶
func (elb *FakeELBV2) DeleteLoadBalancer(*elbv2.DeleteLoadBalancerInput) (*elbv2.DeleteLoadBalancerOutput, error)
DeleteLoadBalancer is not implemented but is required for interface conformance
func (*FakeELBV2) DeleteTargetGroup ¶
func (elb *FakeELBV2) DeleteTargetGroup(*elbv2.DeleteTargetGroupInput) (*elbv2.DeleteTargetGroupOutput, error)
DeleteTargetGroup is not implemented but is required for interface conformance
func (*FakeELBV2) DeregisterTargets ¶
func (elb *FakeELBV2) DeregisterTargets(*elbv2.DeregisterTargetsInput) (*elbv2.DeregisterTargetsOutput, error)
DeregisterTargets is not implemented but is required for interface conformance
func (*FakeELBV2) DescribeListeners ¶
func (elb *FakeELBV2) DescribeListeners(*elbv2.DescribeListenersInput) (*elbv2.DescribeListenersOutput, error)
DescribeListeners is not implemented but is required for interface conformance
func (*FakeELBV2) DescribeLoadBalancerAttributes ¶
func (elb *FakeELBV2) DescribeLoadBalancerAttributes(*elbv2.DescribeLoadBalancerAttributesInput) (*elbv2.DescribeLoadBalancerAttributesOutput, error)
DescribeLoadBalancerAttributes is not implemented but is required for interface conformance
func (*FakeELBV2) DescribeLoadBalancers ¶
func (elb *FakeELBV2) DescribeLoadBalancers(*elbv2.DescribeLoadBalancersInput) (*elbv2.DescribeLoadBalancersOutput, error)
DescribeLoadBalancers is not implemented but is required for interface conformance
func (*FakeELBV2) DescribeTargetGroupAttributes ¶
func (elb *FakeELBV2) DescribeTargetGroupAttributes(*elbv2.DescribeTargetGroupAttributesInput) (*elbv2.DescribeTargetGroupAttributesOutput, error)
DescribeTargetGroupAttributes is not implemented but is required for interface conformance
func (*FakeELBV2) DescribeTargetGroups ¶
func (elb *FakeELBV2) DescribeTargetGroups(*elbv2.DescribeTargetGroupsInput) (*elbv2.DescribeTargetGroupsOutput, error)
DescribeTargetGroups is not implemented but is required for interface conformance
func (*FakeELBV2) DescribeTargetHealth ¶
func (elb *FakeELBV2) DescribeTargetHealth(input *elbv2.DescribeTargetHealthInput) (*elbv2.DescribeTargetHealthOutput, error)
DescribeTargetHealth is not implemented but is required for interface conformance
func (*FakeELBV2) ModifyListener ¶
func (elb *FakeELBV2) ModifyListener(*elbv2.ModifyListenerInput) (*elbv2.ModifyListenerOutput, error)
ModifyListener is not implemented but is required for interface conformance
func (*FakeELBV2) ModifyLoadBalancerAttributes ¶
func (elb *FakeELBV2) ModifyLoadBalancerAttributes(*elbv2.ModifyLoadBalancerAttributesInput) (*elbv2.ModifyLoadBalancerAttributesOutput, error)
ModifyLoadBalancerAttributes is not implemented but is required for interface conformance
func (*FakeELBV2) ModifyTargetGroup ¶
func (elb *FakeELBV2) ModifyTargetGroup(*elbv2.ModifyTargetGroupInput) (*elbv2.ModifyTargetGroupOutput, error)
ModifyTargetGroup is not implemented but is required for interface conformance
func (*FakeELBV2) ModifyTargetGroupAttributes ¶
func (elb *FakeELBV2) ModifyTargetGroupAttributes(*elbv2.ModifyTargetGroupAttributesInput) (*elbv2.ModifyTargetGroupAttributesOutput, error)
ModifyTargetGroupAttributes is not implemented but is required for interface conformance
func (*FakeELBV2) RegisterTargets ¶
func (elb *FakeELBV2) RegisterTargets(*elbv2.RegisterTargetsInput) (*elbv2.RegisterTargetsOutput, error)
RegisterTargets is not implemented but is required for interface conformance
func (*FakeELBV2) WaitUntilLoadBalancersDeleted ¶
func (elb *FakeELBV2) WaitUntilLoadBalancersDeleted(*elbv2.DescribeLoadBalancersInput) error
WaitUntilLoadBalancersDeleted is not implemented but is required for interface conformance
type FakeKMS ¶
type FakeKMS struct {
// contains filtered or unexported fields
}
FakeKMS is a fake KMS client used for testing
func (*FakeKMS) DescribeKey ¶
func (kms *FakeKMS) DescribeKey(*kms.DescribeKeyInput) (*kms.DescribeKeyOutput, error)
DescribeKey is not implemented but is required for interface conformance
type FakeMetadata ¶
type FakeMetadata struct {
// contains filtered or unexported fields
}
FakeMetadata is a fake EC2 metadata service client used for testing
func (*FakeMetadata) GetMetadata ¶
func (m *FakeMetadata) GetMetadata(key string) (string, error)
GetMetadata returns fake EC2 metadata for testing
func (*FakeMetadata) Region ¶ added in v1.27.1
func (m *FakeMetadata) Region() (string, error)
Region returns AWS region
type IPPermissionMatchDesc ¶
type IPPermissionMatchDesc struct {
Description string
}
IPPermissionMatchDesc checks whether specific IPPermission contains description.
func (IPPermissionMatchDesc) Test ¶
func (p IPPermissionMatchDesc) Test(perm *ec2.IpPermission) bool
Test whether specific IPPermission contains description.
type IPPermissionNotMatch ¶
type IPPermissionNotMatch struct {
Predicate IPPermissionPredicate
}
IPPermissionNotMatch is the *not* operator for Predicate
func (IPPermissionNotMatch) Test ¶
func (p IPPermissionNotMatch) Test(perm *ec2.IpPermission) bool
Test whether specific IPPermission not match the embed predicate.
type IPPermissionPredicate ¶
type IPPermissionPredicate interface { // Test checks whether specified IPPermission matches condition. Test(perm *ec2.IpPermission) bool }
IPPermissionPredicate is an predicate to test whether IPPermission matches some condition.
type IPPermissionSet ¶
type IPPermissionSet map[string]*ec2.IpPermission
IPPermissionSet maps IP strings of strings to EC2 IpPermissions
func NewIPPermissionSet ¶
func NewIPPermissionSet(items ...*ec2.IpPermission) IPPermissionSet
NewIPPermissionSet creates a new IPPermissionSet
func (IPPermissionSet) Delete ¶
func (s IPPermissionSet) Delete(items ...*ec2.IpPermission)
Delete delete permission from the set.
func (IPPermissionSet) DeleteIf ¶
func (s IPPermissionSet) DeleteIf(predicate IPPermissionPredicate)
DeleteIf delete permission from the set if permission matches predicate.
func (IPPermissionSet) Difference ¶
func (s IPPermissionSet) Difference(s2 IPPermissionSet) IPPermissionSet
Difference returns a set of objects that are not in s2 For example: s1 = {a1, a2, a3} s2 = {a1, a2, a4, a5} s1.Difference(s2) = {a3} s2.Difference(s1) = {a4, a5}
func (IPPermissionSet) Equal ¶
func (s IPPermissionSet) Equal(s2 IPPermissionSet) bool
Equal returns true if and only if s is equal (as a set) to s2. Two sets are equal if their membership is identical. (In practice, this means same elements, order doesn't matter)
func (IPPermissionSet) Insert ¶
func (s IPPermissionSet) Insert(items ...*ec2.IpPermission)
Insert adds items to the set.
func (IPPermissionSet) IsSuperset ¶
func (s IPPermissionSet) IsSuperset(s2 IPPermissionSet) bool
IsSuperset returns true if and only if s is a superset of s2.
func (IPPermissionSet) List ¶
func (s IPPermissionSet) List() []*ec2.IpPermission
List returns the contents as a slice. Order is not defined.
func (IPPermissionSet) Ungroup ¶
func (s IPPermissionSet) Ungroup() IPPermissionSet
Ungroup splits permissions out into individual permissions EC2 will combine permissions with the same port but different SourceRanges together, for example We ungroup them so we can process them
type InstanceID ¶
type InstanceID string
InstanceID represents the ID of the instance in the AWS API, e.g. i-12345678 The "traditional" format is "i-12345678" A new longer format is also being introduced: "i-12345678abcdef01" We should not assume anything about the length or format, though it seems reasonable to assume that instances will continue to start with "i-".
type KMS ¶
type KMS interface {
DescribeKey(*kms.DescribeKeyInput) (*kms.DescribeKeyOutput, error)
}
KMS is a simple pass-through of the Key Management Service client interface, which allows for testing.
type KubernetesInstanceID ¶
type KubernetesInstanceID string
KubernetesInstanceID represents the id for an instance in the kubernetes API; the following form
- aws:///<zone>/<awsInstanceId>
- aws:////<awsInstanceId>
- aws:///<zone>/fargate-<eni-ip-address>
- <awsInstanceId>
func (KubernetesInstanceID) MapToAWSInstanceID ¶
func (name KubernetesInstanceID) MapToAWSInstanceID() (InstanceID, error)
MapToAWSInstanceID extracts the InstanceID from the KubernetesInstanceID
type ResourceLifecycle ¶
type ResourceLifecycle string
ResourceLifecycle is the cluster lifecycle state used in tagging
type Services ¶
type Services interface { Compute(region string) (iface.EC2, error) LoadBalancing(region string) (ELB, error) LoadBalancingV2(region string) (ELBV2, error) Metadata() (config.EC2Metadata, error) KeyManagement(region string) (KMS, error) }
Services is an abstraction over AWS, to allow mocking/other implementations