Documentation ¶
Index ¶
- Constants
- func AWSErrorCode(err error) string
- func AWSErrorMessage(err error) string
- func EC2TagSpecification(resourceType ec2types.ResourceType, tags map[string]string) []ec2types.TagSpecification
- func ELBv2Tags(tags map[string]string) []elbv2types.Tag
- func FindASGTag(tags []autoscalingtypes.TagDescription, key string) (string, bool)
- func FindAutoscalingGroups(c AWSCloud, tags map[string]string) ([]*autoscalingtypes.AutoScalingGroup, error)
- func FindEC2Tag(tags []ec2types.Tag, key string) (string, bool)
- func FindELBTag(tags []elbtypes.Tag, key string) (string, bool)
- func FindELBV2Tag(tags []elbv2types.Tag, key string) (string, bool)
- func FindRegion(cluster *kops.Cluster) (string, error)
- func GetClusterName40(cluster string) string
- func GetInstanceCertificateNames(instances *ec2.DescribeInstancesOutput) (addrs []string, err error)
- func GetResourceName32(cluster string, prefix string) string
- func GetRolesInInstanceProfile(c AWSCloud, profileName string) ([]string, error)
- func IsIAMNoSuchEntityException(err error) bool
- func MatchesElbV2Tags(tags map[string]string, actual []elbv2types.Tag) bool
- func NameForExternalTargetGroup(targetGroupARN string) (string, error)
- func NewAWSAuthenticator(ctx context.Context, region string) (bootstrap.Authenticator, error)
- func NewAWSVerifier(ctx context.Context, opt *AWSVerifierOptions) (bootstrap.Verifier, error)
- func NewEC2Filter(name string, values ...string) ec2types.Filter
- func RegionFromMetadata(ctx context.Context) (string, error)
- func ResetAWSCloudInstances()
- func ValidateRegion(ctx context.Context, region string) error
- func ValidateZones(zones []string, cloud AWSCloud) error
- type AWSAPITarget
- func (t *AWSAPITarget) AddAWSTags(id string, expected map[string]string) error
- func (t *AWSAPITarget) AddELBTags(loadBalancerName string, expected map[string]string) error
- func (t *AWSAPITarget) AddELBV2Tags(ResourceArn string, expected map[string]string) error
- func (t *AWSAPITarget) CreateTags(id string, tags map[string]string) error
- func (t *AWSAPITarget) DefaultCheckExisting() bool
- func (t *AWSAPITarget) DeleteTags(id string, tags map[string]string) error
- func (t *AWSAPITarget) Finish(taskMap map[string]fi.CloudupTask) error
- func (t *AWSAPITarget) GetTags(id string) (map[string]string, error)
- func (t *AWSAPITarget) RemoveELBTags(loadBalancerName string, expected map[string]string) error
- func (t *AWSAPITarget) RemoveELBV2Tags(ResourceArn string, expected map[string]string) error
- func (t *AWSAPITarget) UpdateTags(id string, tags map[string]string) error
- func (t *AWSAPITarget) WaitForInstanceRunning(instanceID string) error
- type AWSCloud
- type AWSMachineTypeInfo
- type AWSVerifierOptions
- type EphemeralDevice
- type GetCallerIdentityResponse
- type GetCallerIdentityResult
- type LoadBalancerInfo
- type MockAWSCloud
- func (c *MockAWSCloud) AccountInfo(ctx context.Context) (string, string, error)
- func (c *MockAWSCloud) AddAWSTags(id string, expected map[string]string) error
- func (c *MockAWSCloud) AddTags(name *string, tags map[string]string)
- func (c *MockAWSCloud) Autoscaling() awsinterfaces.AutoScalingAPI
- func (c *MockAWSCloud) BuildFilters(name *string) []ec2types.Filter
- func (c *MockAWSCloud) BuildTags(name *string) map[string]string
- func (c *MockAWSCloud) Config() aws.Config
- func (c *MockAWSCloud) CreateELBTags(loadBalancerName string, tags map[string]string) error
- func (c *MockAWSCloud) CreateELBV2Tags(ResourceArn string, tags map[string]string) error
- func (c *MockAWSCloud) CreateTags(resourceId string, tags map[string]string) error
- func (c *MockAWSCloud) DefaultInstanceType(cluster *kops.Cluster, ig *kops.InstanceGroup) (string, error)
- func (c *MockAWSCloud) DeleteGroup(g *cloudinstances.CloudInstanceGroup) error
- func (c *MockAWSCloud) DeleteInstance(i *cloudinstances.CloudInstance) error
- func (c *MockAWSCloud) DeleteTags(id string, tags map[string]string) error
- func (c *MockAWSCloud) DeregisterInstance(i *cloudinstances.CloudInstance) error
- func (c *MockAWSCloud) DescribeAvailabilityZones() ([]ec2types.AvailabilityZone, error)
- func (c *MockAWSCloud) DescribeELBTags(loadBalancerNames []string) (map[string][]elbtypes.Tag, error)
- func (c *MockAWSCloud) DescribeELBV2Tags(loadBalancerArns []string) (map[string][]elbv2types.Tag, error)
- func (c *MockAWSCloud) DescribeInstance(instanceID string) (*ec2types.Instance, error)
- func (c *MockAWSCloud) DescribeInstanceType(instanceType string) (*ec2types.InstanceTypeInfo, error)
- func (c *MockAWSCloud) DescribeVPC(vpcID string) (*ec2types.Vpc, error)
- func (c *MockAWSCloud) DetachInstance(i *cloudinstances.CloudInstance) error
- func (c *MockAWSCloud) EC2() awsinterfaces.EC2API
- func (c *MockAWSCloud) ELB() awsinterfaces.ELBAPI
- func (c *MockAWSCloud) ELBV2() awsinterfaces.ELBV2API
- func (c *MockAWSCloud) EventBridge() awsinterfaces.EventBridgeAPI
- func (c *MockAWSCloud) FindClusterStatus(cluster *kops.Cluster) (*kops.ClusterStatus, error)
- func (c *MockAWSCloud) FindELBByNameTag(findNameTag string) (*elbtypes.LoadBalancerDescription, error)
- func (c *MockAWSCloud) FindELBV2NetworkInterfacesByName(vpcID, loadBalancerName string) ([]ec2types.NetworkInterface, error)
- func (c *MockAWSCloud) FindVPCInfo(id string) (*fi.VPCInfo, error)
- func (c *MockAWSCloud) GetApiIngressStatus(cluster *kops.Cluster) ([]fi.ApiIngressStatus, error)
- func (c *MockAWSCloud) GetCloudGroups(cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, ...) (map[string]*cloudinstances.CloudInstanceGroup, error)
- func (c *MockAWSCloud) GetELBTags(loadBalancerName string) (map[string]string, error)
- func (c *MockAWSCloud) GetELBV2Tags(ResourceArn string) (map[string]string, error)
- func (c *MockAWSCloud) GetTags(resourceID string) (map[string]string, error)
- func (c *MockAWSCloud) IAM() awsinterfaces.IAMAPI
- func (c *MockAWSCloud) Region() string
- func (c *MockAWSCloud) RemoveELBTags(loadBalancerName string, tags map[string]string) error
- func (c *MockAWSCloud) RemoveELBV2Tags(ResourceArn string, tags map[string]string) error
- func (c *MockAWSCloud) ResolveImage(name string) (*ec2types.Image, error)
- func (c *MockAWSCloud) Route53() awsinterfaces.Route53API
- func (c *MockAWSCloud) SQS() awsinterfaces.SQSAPI
- func (c *MockAWSCloud) SSM() awsinterfaces.SSMAPI
- func (c *MockAWSCloud) Spotinst() spotinst.Cloud
- func (c *MockAWSCloud) Tags() map[string]string
- func (c *MockAWSCloud) UpdateTags(id string, tags map[string]string) error
- func (c *MockAWSCloud) WithTags(tags map[string]string) AWSCloud
- type MockCloud
- type ResponseMetadata
- type TargetGroupInfo
Constants ¶
const ( DescribeTagsMaxAttempts = 120 DescribeTagsRetryInterval = 2 * time.Second DescribeTagsLogInterval = 10 // this is in "retry intervals" )
const ( CreateTagsMaxAttempts = 120 CreateTagsRetryInterval = 2 * time.Second CreateTagsLogInterval = 10 // this is in "retry intervals" )
const ( DeleteTagsMaxAttempts = 120 DeleteTagsRetryInterval = 2 * time.Second DeleteTagsLogInterval = 10 // this is in "retry intervals" )
const ( TagClusterName = "KubernetesCluster" TagNameRolePrefix = "k8s.io/role/" TagNameEtcdClusterPrefix = "k8s.io/etcd/" )
const ( WellKnownAccountAmazonLinux2 = "137112412989" WellKnownAccountDebian = "136693071363" WellKnownAccountFlatcar = "075585003325" WellKnownAccountRedhat = "309956199498" WellKnownAccountUbuntu = "099720109477" )
const AWSAuthenticationTokenPrefixV1 = "x-aws-sts "
const AWSAuthenticationTokenPrefixV2 = "x-aws-sts-v2 "
const AWSErrCodeInvalidAction = "InvalidAction"
AWSErrCodeInvalidAction is returned in AWS partitions that don't support certain actions
const ClientMaxRetries = 13
By default, aws-sdk-go-v2 only retries 3 times, which doesn't give much time for exponential backoff to work for serious issues. At 13 retries, we'll try a given request for up to ~6m with exponential backoff along the way.
const KopsResourceRevisionTag = "kops.k8s.io/revision"
KopsResourceRevisionTag is the tag used to store the revision timestamp, when we are forced to create a new version of a resource because we cannot modify it in-place. This happens when the resource field is immutable; it also happens for ELBs, when we cannot have two ELBs pointing at the same target group and thus must create a second.
const TagNameClusterOwnershipPrefix = "kubernetes.io/cluster/"
TagNameClusterOwnershipPrefix is the AWS tag used for ownership
const TagNameKopsRole = "kubernetes.io/kops/role"
TagNameKopsRole is the AWS tag used to identify the role an object plays for a cluster
const TagRoleControlPlane = "control-plane"
const TagRoleMaster = "master"
Variables ¶
This section is empty.
Functions ¶
func AWSErrorCode ¶
AWSErrorCode returns the aws error code, if it is an awserr.Error or smithy.APIError, otherwise ""
func AWSErrorMessage ¶
AWSErrorMessage returns the aws error message, if it is an awserr.Error or smithy.APIError, otherwise ""
func EC2TagSpecification ¶ added in v1.19.0
func EC2TagSpecification(resourceType ec2types.ResourceType, tags map[string]string) []ec2types.TagSpecification
EC2TagSpecification converts a map of tags to an EC2 TagSpecification
func ELBv2Tags ¶ added in v1.21.0
func ELBv2Tags(tags map[string]string) []elbv2types.Tag
ELBv2Tags converts a map of tags to ELBv2 Tags
func FindASGTag ¶
func FindASGTag(tags []autoscalingtypes.TagDescription, key string) (string, bool)
FindASGTag find the value of the tag with the specified key
func FindAutoscalingGroups ¶ added in v1.10.0
func FindAutoscalingGroups(c AWSCloud, tags map[string]string) ([]*autoscalingtypes.AutoScalingGroup, error)
FindAutoscalingGroups finds autoscaling groups matching the specified tags This isn't entirely trivial because autoscaling doesn't let us filter with as much precision as we would like
func FindEC2Tag ¶
FindEC2Tag find the value of the tag with the specified key
func FindELBTag ¶
FindELBTag find the value of the tag with the specified key
func FindELBV2Tag ¶ added in v1.11.0
func FindELBV2Tag(tags []elbv2types.Tag, key string) (string, bool)
FindELBV2Tag find the value of the tag with the specified key
func FindRegion ¶ added in v1.10.0
FindRegion determines the region from the zones specified in the cluster
func GetClusterName40 ¶ added in v1.21.2
GetClusterName40 will attempt to calculate a meaningful cluster name with a max length of 40
func GetInstanceCertificateNames ¶ added in v1.21.3
func GetInstanceCertificateNames(instances *ec2.DescribeInstancesOutput) (addrs []string, err error)
GetInstanceCertificateNames returns the instance hostname and addresses that should go into certificates. The first value is the node name and any additional values are the DNS name and IP addresses.
func GetResourceName32 ¶ added in v1.18.3
GetResourceName32 will attempt to calculate a meaningful name for a resource given a prefix Will never return a string longer than 32 chars
func GetRolesInInstanceProfile ¶ added in v1.19.1
GetRolesInInstanceProfile return role names which are associated with the instance profile specified by profileName.
func IsIAMNoSuchEntityException ¶ added in v1.30.0
func MatchesElbV2Tags ¶ added in v1.29.0
func MatchesElbV2Tags(tags map[string]string, actual []elbv2types.Tag) bool
func NameForExternalTargetGroup ¶ added in v1.29.0
NameForExternalTargetGroup will attempt to calculate a meaningful name for a target group given an ARN.
func NewAWSAuthenticator ¶ added in v1.19.0
func NewAWSVerifier ¶ added in v1.19.0
func RegionFromMetadata ¶ added in v1.21.0
RegionFromMetadata returns the current region from the aws metdata
func ResetAWSCloudInstances ¶ added in v1.27.0
func ResetAWSCloudInstances()
func ValidateRegion ¶
ValidateRegion checks that an AWS region name is valid
func ValidateZones ¶
ValidateZones checks that every zone in the sliced passed is recognized
Types ¶
type AWSAPITarget ¶
type AWSAPITarget struct {
Cloud AWSCloud
}
func NewAWSAPITarget ¶
func NewAWSAPITarget(cloud AWSCloud) *AWSAPITarget
func (*AWSAPITarget) AddAWSTags ¶
func (t *AWSAPITarget) AddAWSTags(id string, expected map[string]string) error
func (*AWSAPITarget) AddELBTags ¶
func (t *AWSAPITarget) AddELBTags(loadBalancerName string, expected map[string]string) error
func (*AWSAPITarget) AddELBV2Tags ¶ added in v1.19.0
func (t *AWSAPITarget) AddELBV2Tags(ResourceArn string, expected map[string]string) error
func (*AWSAPITarget) CreateTags ¶ added in v1.19.0
func (t *AWSAPITarget) CreateTags(id string, tags map[string]string) error
func (*AWSAPITarget) DefaultCheckExisting ¶ added in v1.26.0
func (t *AWSAPITarget) DefaultCheckExisting() bool
func (*AWSAPITarget) DeleteTags ¶ added in v1.10.0
func (t *AWSAPITarget) DeleteTags(id string, tags map[string]string) error
func (*AWSAPITarget) Finish ¶
func (t *AWSAPITarget) Finish(taskMap map[string]fi.CloudupTask) error
func (*AWSAPITarget) GetTags ¶ added in v1.19.0
func (t *AWSAPITarget) GetTags(id string) (map[string]string, error)
func (*AWSAPITarget) RemoveELBTags ¶ added in v1.15.1
func (t *AWSAPITarget) RemoveELBTags(loadBalancerName string, expected map[string]string) error
func (*AWSAPITarget) RemoveELBV2Tags ¶ added in v1.19.0
func (t *AWSAPITarget) RemoveELBV2Tags(ResourceArn string, expected map[string]string) error
func (*AWSAPITarget) UpdateTags ¶ added in v1.19.0
func (t *AWSAPITarget) UpdateTags(id string, tags map[string]string) error
func (*AWSAPITarget) WaitForInstanceRunning ¶
func (t *AWSAPITarget) WaitForInstanceRunning(instanceID string) error
type AWSCloud ¶
type AWSCloud interface { fi.Cloud Config() aws.Config EC2() awsinterfaces.EC2API IAM() awsinterfaces.IAMAPI ELB() awsinterfaces.ELBAPI ELBV2() awsinterfaces.ELBV2API Autoscaling() awsinterfaces.AutoScalingAPI Route53() awsinterfaces.Route53API Spotinst() spotinst.Cloud SQS() awsinterfaces.SQSAPI EventBridge() awsinterfaces.EventBridgeAPI SSM() awsinterfaces.SSMAPI // TODO: Document and rationalize these tags/filters methods AddTags(name *string, tags map[string]string) BuildFilters(name *string) []ec2types.Filter BuildTags(name *string) map[string]string Tags() map[string]string // GetTags will fetch the tags for the specified resource, retrying (up to MaxDescribeTagsAttempts) if it hits an eventual-consistency type error GetTags(resourceId string) (map[string]string, error) // CreateTags will add/modify tags to the specified resource, retrying up to MaxCreateTagsAttempts times if it hits an eventual-consistency type error CreateTags(resourceId string, tags map[string]string) error // DeleteTags will remove tags from the specified resource, retrying up to MaxCreateTagsAttempts times if it hits an eventual-consistency type error DeleteTags(resourceId string, tags map[string]string) error // UpdateTags will update tags of the specified resource to match tags, using getTags(), createTags() and deleteTags() UpdateTags(resourceId string, tags map[string]string) error AddAWSTags(id string, expected map[string]string) error GetELBTags(loadBalancerName string) (map[string]string, error) GetELBV2Tags(ResourceArn string) (map[string]string, error) // CreateELBTags will add tags to the specified loadBalancer, retrying up to MaxCreateTagsAttempts times if it hits an eventual-consistency type error CreateELBTags(loadBalancerName string, tags map[string]string) error CreateELBV2Tags(ResourceArn string, tags map[string]string) error // RemoveELBTags will remove tags from the specified loadBalancer, retrying up to MaxCreateTagsAttempts times if it hits an eventual-consistency type error RemoveELBTags(loadBalancerName string, tags map[string]string) error RemoveELBV2Tags(ResourceArn string, tags map[string]string) error FindELBByNameTag(findNameTag string) (*elbtypes.LoadBalancerDescription, error) DescribeELBTags(loadBalancerNames []string) (map[string][]elbtypes.Tag, error) // TODO: Remove, replace with awsup.ListELBV2LoadBalancers DescribeELBV2Tags(loadBalancerNames []string) (map[string][]elbv2types.Tag, error) FindELBV2NetworkInterfacesByName(vpcID string, loadBalancerName string) ([]ec2types.NetworkInterface, error) // DescribeInstance is a helper that queries for the specified instance by id DescribeInstance(instanceID string) (*ec2types.Instance, error) // DescribeVPC is a helper that queries for the specified vpc by id DescribeVPC(vpcID string) (*ec2types.Vpc, error) DescribeAvailabilityZones() ([]ec2types.AvailabilityZone, error) // ResolveImage finds an AMI image based on the given name. // The name can be one of: // `ami-...` in which case it is presumed to be an id // owner/name in which case we find the image with the specified name, owned by owner // name in which case we find the image with the specified name, with the current owner ResolveImage(name string) (*ec2types.Image, error) // WithTags created a copy of AWSCloud with the specified default-tags bound WithTags(tags map[string]string) AWSCloud // DefaultInstanceType determines a suitable instance type for the specified instance group DefaultInstanceType(cluster *kops.Cluster, ig *kops.InstanceGroup) (string, error) // DescribeInstanceType calls ec2.DescribeInstanceType to get information for a particular instance type DescribeInstanceType(instanceType string) (*ec2types.InstanceTypeInfo, error) // AccountInfo returns the AWS account ID and AWS partition that we are deploying into AccountInfo(ctx context.Context) (string, string, error) }
type AWSMachineTypeInfo ¶
type AWSMachineTypeInfo struct { Name ec2types.InstanceType MemoryGB float32 Cores int32 EphemeralDisks []int64 GPU bool MaxPods int32 InstanceENIs int32 InstanceIPsPerENI int32 }
func GetMachineTypeInfo ¶
func GetMachineTypeInfo(c AWSCloud, machineType ec2types.InstanceType) (*AWSMachineTypeInfo, error)
func (*AWSMachineTypeInfo) EphemeralDevices ¶
func (m *AWSMachineTypeInfo) EphemeralDevices() []*EphemeralDevice
type AWSVerifierOptions ¶ added in v1.19.0
type EphemeralDevice ¶
type GetCallerIdentityResponse ¶ added in v1.19.0
type GetCallerIdentityResponse struct { XMLName xml.Name `xml:"GetCallerIdentityResponse"` GetCallerIdentityResult []GetCallerIdentityResult `xml:"GetCallerIdentityResult"` ResponseMetadata []ResponseMetadata `xml:"ResponseMetadata"` }
type GetCallerIdentityResult ¶ added in v1.19.0
type LoadBalancerInfo ¶ added in v1.29.0
type LoadBalancerInfo struct { LoadBalancer elbv2types.LoadBalancer Tags []elbv2types.Tag // contains filtered or unexported fields }
func FindLatestELBV2ByNameTag ¶ added in v1.29.0
func FindLatestELBV2ByNameTag(loadBalancers []*LoadBalancerInfo, findNameTag string) *LoadBalancerInfo
func ListELBV2LoadBalancers ¶ added in v1.29.0
func ListELBV2LoadBalancers(ctx context.Context, cloud AWSCloud) ([]*LoadBalancerInfo, error)
func (*LoadBalancerInfo) ARN ¶ added in v1.29.0
func (i *LoadBalancerInfo) ARN() string
ARN returns the ARN of the load balancer.
func (*LoadBalancerInfo) GetTag ¶ added in v1.29.0
func (i *LoadBalancerInfo) GetTag(key string) (string, bool)
GetTag returns the value of the tag with the given key.
func (*LoadBalancerInfo) NameTag ¶ added in v1.29.0
func (i *LoadBalancerInfo) NameTag() string
NameTag returns the value of the tag with the key "Name".
type MockAWSCloud ¶
type MockAWSCloud struct { MockCloud // contains filtered or unexported fields }
func BuildMockAWSCloud ¶ added in v1.10.0
func BuildMockAWSCloud(region string, zoneLetters string) *MockAWSCloud
func InstallMockAWSCloud ¶
func InstallMockAWSCloud(region string, zoneLetters string) *MockAWSCloud
func (*MockAWSCloud) AccountInfo ¶ added in v1.19.0
AccountInfo returns the AWS account ID and AWS partition that we are deploying into
func (*MockAWSCloud) AddAWSTags ¶
func (c *MockAWSCloud) AddAWSTags(id string, expected map[string]string) error
func (*MockAWSCloud) Autoscaling ¶
func (c *MockAWSCloud) Autoscaling() awsinterfaces.AutoScalingAPI
func (*MockAWSCloud) BuildFilters ¶
func (c *MockAWSCloud) BuildFilters(name *string) []ec2types.Filter
func (*MockAWSCloud) Config ¶ added in v1.30.0
func (c *MockAWSCloud) Config() aws.Config
func (*MockAWSCloud) CreateELBTags ¶
func (c *MockAWSCloud) CreateELBTags(loadBalancerName string, tags map[string]string) error
func (*MockAWSCloud) CreateELBV2Tags ¶ added in v1.11.0
func (c *MockAWSCloud) CreateELBV2Tags(ResourceArn string, tags map[string]string) error
func (*MockAWSCloud) CreateTags ¶
func (c *MockAWSCloud) CreateTags(resourceId string, tags map[string]string) error
func (*MockAWSCloud) DefaultInstanceType ¶ added in v1.10.0
func (c *MockAWSCloud) DefaultInstanceType(cluster *kops.Cluster, ig *kops.InstanceGroup) (string, error)
DefaultInstanceType determines an instance type for the specified cluster & instance group
func (*MockAWSCloud) DeleteGroup ¶ added in v1.10.0
func (c *MockAWSCloud) DeleteGroup(g *cloudinstances.CloudInstanceGroup) error
func (*MockAWSCloud) DeleteInstance ¶ added in v1.10.0
func (c *MockAWSCloud) DeleteInstance(i *cloudinstances.CloudInstance) error
func (*MockAWSCloud) DeleteTags ¶ added in v1.10.0
func (c *MockAWSCloud) DeleteTags(id string, tags map[string]string) error
func (*MockAWSCloud) DeregisterInstance ¶ added in v1.24.0
func (c *MockAWSCloud) DeregisterInstance(i *cloudinstances.CloudInstance) error
func (*MockAWSCloud) DescribeAvailabilityZones ¶
func (c *MockAWSCloud) DescribeAvailabilityZones() ([]ec2types.AvailabilityZone, error)
func (*MockAWSCloud) DescribeELBTags ¶ added in v1.21.3
func (*MockAWSCloud) DescribeELBV2Tags ¶ added in v1.21.3
func (c *MockAWSCloud) DescribeELBV2Tags(loadBalancerArns []string) (map[string][]elbv2types.Tag, error)
func (*MockAWSCloud) DescribeInstance ¶
func (c *MockAWSCloud) DescribeInstance(instanceID string) (*ec2types.Instance, error)
func (*MockAWSCloud) DescribeInstanceType ¶ added in v1.19.0
func (c *MockAWSCloud) DescribeInstanceType(instanceType string) (*ec2types.InstanceTypeInfo, error)
DescribeInstanceType calls ec2.DescribeInstanceType to get information for a particular instance type
func (*MockAWSCloud) DescribeVPC ¶
func (c *MockAWSCloud) DescribeVPC(vpcID string) (*ec2types.Vpc, error)
func (*MockAWSCloud) DetachInstance ¶ added in v1.18.0
func (c *MockAWSCloud) DetachInstance(i *cloudinstances.CloudInstance) error
func (*MockAWSCloud) EC2 ¶
func (c *MockAWSCloud) EC2() awsinterfaces.EC2API
func (*MockAWSCloud) ELB ¶
func (c *MockAWSCloud) ELB() awsinterfaces.ELBAPI
func (*MockAWSCloud) ELBV2 ¶ added in v1.11.0
func (c *MockAWSCloud) ELBV2() awsinterfaces.ELBV2API
func (*MockAWSCloud) EventBridge ¶ added in v1.21.0
func (c *MockAWSCloud) EventBridge() awsinterfaces.EventBridgeAPI
func (*MockAWSCloud) FindClusterStatus ¶ added in v1.10.0
func (c *MockAWSCloud) FindClusterStatus(cluster *kops.Cluster) (*kops.ClusterStatus, error)
FindClusterStatus discovers the status of the cluster, by looking for the tagged etcd volumes
func (*MockAWSCloud) FindELBByNameTag ¶ added in v1.21.3
func (c *MockAWSCloud) FindELBByNameTag(findNameTag string) (*elbtypes.LoadBalancerDescription, error)
func (*MockAWSCloud) FindELBV2NetworkInterfacesByName ¶ added in v1.26.0
func (c *MockAWSCloud) FindELBV2NetworkInterfacesByName(vpcID, loadBalancerName string) ([]ec2types.NetworkInterface, error)
func (*MockAWSCloud) FindVPCInfo ¶ added in v1.10.0
func (c *MockAWSCloud) FindVPCInfo(id string) (*fi.VPCInfo, error)
func (*MockAWSCloud) GetApiIngressStatus ¶ added in v1.21.3
func (c *MockAWSCloud) GetApiIngressStatus(cluster *kops.Cluster) ([]fi.ApiIngressStatus, error)
func (*MockAWSCloud) GetCloudGroups ¶ added in v1.10.0
func (c *MockAWSCloud) GetCloudGroups(cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error)
func (*MockAWSCloud) GetELBTags ¶
func (c *MockAWSCloud) GetELBTags(loadBalancerName string) (map[string]string, error)
func (*MockAWSCloud) GetELBV2Tags ¶ added in v1.11.0
func (c *MockAWSCloud) GetELBV2Tags(ResourceArn string) (map[string]string, error)
func (*MockAWSCloud) GetTags ¶
func (c *MockAWSCloud) GetTags(resourceID string) (map[string]string, error)
func (*MockAWSCloud) IAM ¶
func (c *MockAWSCloud) IAM() awsinterfaces.IAMAPI
func (*MockAWSCloud) Region ¶
func (c *MockAWSCloud) Region() string
func (*MockAWSCloud) RemoveELBTags ¶ added in v1.15.1
func (c *MockAWSCloud) RemoveELBTags(loadBalancerName string, tags map[string]string) error
func (*MockAWSCloud) RemoveELBV2Tags ¶ added in v1.19.0
func (c *MockAWSCloud) RemoveELBV2Tags(ResourceArn string, tags map[string]string) error
func (*MockAWSCloud) ResolveImage ¶
func (c *MockAWSCloud) ResolveImage(name string) (*ec2types.Image, error)
func (*MockAWSCloud) Route53 ¶
func (c *MockAWSCloud) Route53() awsinterfaces.Route53API
func (*MockAWSCloud) SQS ¶ added in v1.21.0
func (c *MockAWSCloud) SQS() awsinterfaces.SQSAPI
func (*MockAWSCloud) SSM ¶ added in v1.25.3
func (c *MockAWSCloud) SSM() awsinterfaces.SSMAPI
func (*MockAWSCloud) Spotinst ¶ added in v1.11.0
func (c *MockAWSCloud) Spotinst() spotinst.Cloud
func (*MockAWSCloud) Tags ¶
func (c *MockAWSCloud) Tags() map[string]string
func (*MockAWSCloud) UpdateTags ¶ added in v1.19.0
func (c *MockAWSCloud) UpdateTags(id string, tags map[string]string) error
type MockCloud ¶
type MockCloud struct { MockAutoscaling awsinterfaces.AutoScalingAPI MockEC2 awsinterfaces.EC2API MockIAM awsinterfaces.IAMAPI MockRoute53 awsinterfaces.Route53API MockELB awsinterfaces.ELBAPI MockELBV2 awsinterfaces.ELBV2API MockSpotinst spotinst.Cloud MockSQS awsinterfaces.SQSAPI MockEventBridge awsinterfaces.EventBridgeAPI MockSSM awsinterfaces.SSMAPI }
func (*MockCloud) ProviderID ¶
func (c *MockCloud) ProviderID() kops.CloudProviderID
type ResponseMetadata ¶ added in v1.19.0
type ResponseMetadata struct {
RequestId string `xml:"RequestId"`
}
type TargetGroupInfo ¶ added in v1.29.0
type TargetGroupInfo struct { TargetGroup elbv2types.TargetGroup Tags []elbv2types.Tag // ARN holds the arn (amazon id) of the target group. ARN string }
func ListELBV2TargetGroups ¶ added in v1.29.0
func ListELBV2TargetGroups(ctx context.Context, cloud AWSCloud) ([]*TargetGroupInfo, error)
func (*TargetGroupInfo) GetTag ¶ added in v1.29.0
func (i *TargetGroupInfo) GetTag(key string) (string, bool)
GetTag returns the value of the tag with the given key.
func (*TargetGroupInfo) NameTag ¶ added in v1.29.0
func (i *TargetGroupInfo) NameTag() string
NameTag returns the value of the tag with the key "Name".