aws

package
v0.36.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestCategoryDimension           = "category"
	TestNameDimension               = "name"
	GitRefDimension                 = "gitRef"
	ProvisionedNodeCountDimension   = "provisionedNodeCount"
	DeprovisionedNodeCountDimension = "deprovisionedNodeCount"
	PodDensityDimension             = "podDensity"
)

Variables

View Source
var (
	CleanableObjects = []client.Object{
		&v1beta1.EC2NodeClass{},
	}
)
View Source
var EphemeralInitContainerImage = "alpine"
View Source
var ExcludedInstanceFamilies = []string{"m7a", "r7a", "c7a", "r7i", "a1"}

ExcludedInstanceFamilies denotes instance families that have issues during resource registration due to compatibility issues with versions of the VPR Resource Controller. TODO: jmdeal@ remove a1 from exclusion list once Karpenter implicitly filters a1 instances for AL2023 AMI family (incompatible)

View Source
var WindowsDefaultImage = "mcr.microsoft.com/oss/kubernetes/pause:3.9"

Functions

Types

type Environment

type Environment struct {
	*common.Environment
	Region string

	STSAPI        *sts.STS
	EC2API        *ec2.EC2
	SSMAPI        *ssm.SSM
	IAMAPI        *iam.IAM
	FISAPI        *fis.FIS
	EKSAPI        *eks.EKS
	TimeStreamAPI timestreamwriteiface.TimestreamWriteAPI

	SQSProvider sqs.Provider

	ClusterName       string
	ClusterEndpoint   string
	InterruptionQueue string
	PrivateCluster    bool
}

func NewEnvironment

func NewEnvironment(t *testing.T) *Environment

func (*Environment) AfterEach

func (env *Environment) AfterEach()

func (*Environment) BeforeEach

func (env *Environment) BeforeEach()

func (*Environment) Cleanup

func (env *Environment) Cleanup()

func (*Environment) DefaultEC2NodeClass

func (env *Environment) DefaultEC2NodeClass() *v1beta1.EC2NodeClass

func (*Environment) EventuallyExpectInstanceProfileExists

func (env *Environment) EventuallyExpectInstanceProfileExists(profileName string) iam.InstanceProfile

func (*Environment) EventuallyExpectRunInstances

func (env *Environment) EventuallyExpectRunInstances(instanceInput *ec2.RunInstancesInput) *ec2.Reservation

func (*Environment) ExpectAccountID

func (env *Environment) ExpectAccountID() string

func (*Environment) ExpectExperimentTemplateDeleted

func (env *Environment) ExpectExperimentTemplateDeleted(id string)

func (*Environment) ExpectIPv6ClusterDNS

func (env *Environment) ExpectIPv6ClusterDNS() string

func (*Environment) ExpectInstance

func (env *Environment) ExpectInstance(nodeName string) Assertion

func (*Environment) ExpectInstanceProfileCreated

func (env *Environment) ExpectInstanceProfileCreated(instanceProfileName, roleName string)

func (*Environment) ExpectInstanceProfileDeleted

func (env *Environment) ExpectInstanceProfileDeleted(instanceProfileName, roleName string)

func (*Environment) ExpectInstanceStopped

func (env *Environment) ExpectInstanceStopped(nodeName string)

func (*Environment) ExpectInstanceTerminated

func (env *Environment) ExpectInstanceTerminated(nodeName string)

func (*Environment) ExpectMessagesCreated

func (env *Environment) ExpectMessagesCreated(msgs ...interface{})

func (*Environment) ExpectMetric

func (env *Environment) ExpectMetric(name string, value float64, labels map[string]string)

func (*Environment) ExpectParsedProviderID

func (env *Environment) ExpectParsedProviderID(providerID string) string

func (*Environment) ExpectSpotInterruptionExperiment

func (env *Environment) ExpectSpotInterruptionExperiment(instanceIDs ...string) *fis.Experiment

func (*Environment) ExpectSpotInterruptionRole

func (env *Environment) ExpectSpotInterruptionRole() *iam.Role

func (*Environment) ExpectWindowsIPAMDisabled

func (env *Environment) ExpectWindowsIPAMDisabled()

func (*Environment) ExpectWindowsIPAMEnabled

func (env *Environment) ExpectWindowsIPAMEnabled()

func (*Environment) GetCustomAMI

func (env *Environment) GetCustomAMI(amiPath string, versionOffset int) string

func (*Environment) GetInstance

func (env *Environment) GetInstance(nodeName string) ec2.Instance

func (*Environment) GetInstanceByID

func (env *Environment) GetInstanceByID(instanceID string) ec2.Instance

func (*Environment) GetInstanceProfileName

func (env *Environment) GetInstanceProfileName(nodeClass *v1beta1.EC2NodeClass) string

GetInstanceProfileName gets the string for the profile name based on the cluster name, region and the NodeClass name. The length of this string can never exceed the maximum instance profile name limit of 128 characters.

func (*Environment) GetK8sMinorVersion

func (env *Environment) GetK8sMinorVersion(offset int) (int, error)

func (*Environment) GetK8sVersion

func (env *Environment) GetK8sVersion(offset int) string

func (*Environment) GetNetworkInterface

func (env *Environment) GetNetworkInterface(id *string) *ec2.NetworkInterface

func (*Environment) GetNetworkInterfaces

func (env *Environment) GetNetworkInterfaces(ids ...*string) []*ec2.NetworkInterface

func (*Environment) GetSecurityGroups

func (env *Environment) GetSecurityGroups(tags map[string]string) []SecurityGroup

GetSecurityGroups returns all getSecurityGroups matching the label selector

func (*Environment) GetSpotInstanceRequest

func (env *Environment) GetSpotInstanceRequest(id *string) *ec2.SpotInstanceRequest

func (*Environment) GetSubnetNameAndIds

func (env *Environment) GetSubnetNameAndIds(tags map[string]string) []SubnetInfo

GetSubnetNameAndIds returns all subnets matching the label selector

func (*Environment) GetSubnets

func (env *Environment) GetSubnets(tags map[string]string) map[string][]string

GetSubnets returns all subnets matching the label selector mapped from AZ -> {subnet-ids...}

func (*Environment) GetVolume

func (env *Environment) GetVolume(id *string) *ec2.Volume

func (*Environment) GetVolumes

func (env *Environment) GetVolumes(ids ...*string) []*ec2.Volume

func (*Environment) GetZones

func (env *Environment) GetZones() map[string]string

GetZones returns all available zones mapped from zone -> zone type

func (*Environment) MeasureDeprovisioningDurationFor

func (env *Environment) MeasureDeprovisioningDurationFor(f func(), dimensions map[string]string)

func (*Environment) MeasureDurationFor

func (env *Environment) MeasureDurationFor(f func(), eventType EventType, dimensions map[string]string)

MeasureDurationFor observes the duration between the beginning of the function f() and the end of the function f()

func (*Environment) MeasureProvisioningDurationFor

func (env *Environment) MeasureProvisioningDurationFor(f func(), dimensions map[string]string)

type EventType

type EventType string
const (
	ProvisioningEventType   EventType = "provisioning"
	DeprovisioningEventType EventType = "deprovisioning"
)

type NoOpTimeStreamAPI

type NoOpTimeStreamAPI struct {
	timestreamwriteiface.TimestreamWriteAPI
}

type SecurityGroup

type SecurityGroup struct {
	ec2.GroupIdentifier
	Tags []*ec2.Tag
}

type SubnetInfo

type SubnetInfo struct {
	Name string
	ID   string
}

SubnetInfo is a simple struct for testing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL