Documentation ¶
Index ¶
- Constants
- Variables
- func FindImage(ctx context.Context, ec2API awsapi.EC2, ownerAccount, namePattern string) (string, error)
- func MakeImageSearchPatterns(version string) map[string]map[int]string
- func MakeManagedSSMParameterName(version string, amiType ekstypes.AMITypes) (string, error)
- func MakeSSMParameterName(version, instanceType, imageFamily string) (string, error)
- func OwnerAccountID(imageFamily, region string) (string, error)
- func Use(ctx context.Context, ec2API awsapi.EC2, ng *api.NodeGroupBase) error
- type AutoResolver
- type ErrFailedResolution
- type ErrNotFound
- type MultiResolver
- type Resolver
- type SSMResolver
- type UnsupportedQueryError
Constants ¶
const ( ImageClassGeneral = iota ImageClassGPU ImageClassARM )
Variations of image classes
Variables ¶
var ImageClasses = []string{
"ImageClassGeneral",
"ImageClassGPU",
"ImageClassARM",
}
ImageClasses is a list of image class names
Functions ¶
func FindImage ¶
func FindImage(ctx context.Context, ec2API awsapi.EC2, ownerAccount, namePattern string) (string, error)
FindImage will get the AMI to use for the EKS nodes by querying AWS EC2 API. It will only look for images with a status of available and it will pick the image with the newest creation date.
func MakeImageSearchPatterns ¶
MakeImageSearchPatterns creates a map of image search patterns by image OS family and class
func MakeManagedSSMParameterName ¶
MakeManagedSSMParameterName creates an SSM parameter name for a managed nodegroup
func MakeSSMParameterName ¶
MakeSSMParameterName creates an SSM parameter name
func OwnerAccountID ¶
OwnerAccountID returns the AWS account ID that owns worker AMI.
Types ¶
type AutoResolver ¶
type AutoResolver struct {
// contains filtered or unexported fields
}
AutoResolver resolves the AMi to the defaults for the region by querying AWS EC2 API for the AMI to use
type ErrFailedResolution ¶
type ErrFailedResolution struct {
// contains filtered or unexported fields
}
ErrFailedResolution is an error type that represents failure to resolve a region/instance type/image family to an AMI
func NewErrFailedResolution ¶
func NewErrFailedResolution(region, version, instanceType, imageFamily string) *ErrFailedResolution
NewErrFailedResolution creates a new instance of ErrFailedResolution for a give region, instance type and image family
func (*ErrFailedResolution) Error ¶
func (e *ErrFailedResolution) Error() string
Error return the error message
type ErrNotFound ¶
type ErrNotFound struct {
// contains filtered or unexported fields
}
ErrNotFound is an error type that represents failure to find a given ami
func NewErrNotFound ¶
func NewErrNotFound(ami string) *ErrNotFound
NewErrNotFound creates a new instance of ErrNotFound for a given ami
type MultiResolver ¶
type MultiResolver struct {
// contains filtered or unexported fields
}
MultiResolver is a Resolver that delegates to one or more Resolvers. It iterates over the delegate resolvers and returns the first AMI found
func NewMultiResolver ¶
func NewMultiResolver(delegates ...Resolver) *MultiResolver
NewMultiResolver creates and returns a MultiResolver with the specified delegates
type Resolver ¶
type Resolver interface {
Resolve(ctx context.Context, region, version, instanceType, imageFamily string) (string, error)
}
Resolver provides an interface to enable implementing multiple ways to determine which AMI to use from the region/instance type/image family.
func NewAutoResolver ¶
NewAutoResolver creates a new AutoResolver
func NewSSMResolver ¶
NewSSMResolver creates a new AutoResolver.
type SSMResolver ¶
type SSMResolver struct {
// contains filtered or unexported fields
}
SSMResolver resolves the AMI to the defaults for the region by querying AWS SSM get parameter API
type UnsupportedQueryError ¶
type UnsupportedQueryError struct {
// contains filtered or unexported fields
}
UnsupportedQueryError represents an unsupported AMI query error
func (*UnsupportedQueryError) Error ¶
func (ue *UnsupportedQueryError) Error() string
Error returns the error string