Documentation ¶
Index ¶
- Constants
- Variables
- func NewInstanceType(ctx context.Context, info *ec2.InstanceTypeInfo, ...) *cloudprovider.InstanceType
- func NewPricingAPI(sess *session.Session, region string) pricingiface.PricingAPI
- type CloudProvider
- func (c *CloudProvider) Create(ctx context.Context, machine *v1alpha5.Machine) (*v1alpha5.Machine, error)
- func (c *CloudProvider) Delete(ctx context.Context, machine *v1alpha5.Machine) error
- func (c *CloudProvider) Get(ctx context.Context, machineName, provisionerName string) (*v1alpha5.Machine, error)
- func (c *CloudProvider) GetInstanceTypes(ctx context.Context, provisioner *v1alpha5.Provisioner) ([]*cloudprovider.InstanceType, error)
- func (c *CloudProvider) IsMachineDrifted(ctx context.Context, machine *v1alpha5.Machine) (bool, error)
- func (c *CloudProvider) LivenessProbe(req *http.Request) error
- func (c *CloudProvider) Name() string
- type CreateFleetBatcher
- type InstanceProvider
- func (p *InstanceProvider) Create(ctx context.Context, nodeTemplate *v1alpha1.AWSNodeTemplate, ...) (*ec2.Instance, error)
- func (p *InstanceProvider) Delete(ctx context.Context, machine *v1alpha5.Machine) error
- func (p *InstanceProvider) DeleteByID(ctx context.Context, id string) error
- func (p *InstanceProvider) Get(ctx context.Context, machineName string) (*ec2.Instance, error)
- func (p *InstanceProvider) GetByID(ctx context.Context, id string) (*ec2.Instance, error)
- func (p *InstanceProvider) List(ctx context.Context, machineName string) ([]*ec2.Instance, error)
- type InstanceTypeProvider
- type LaunchTemplateProvider
- type PricingProvider
- func (p *PricingProvider) InstanceTypes() []string
- func (p *PricingProvider) LivenessProbe(req *http.Request) error
- func (p *PricingProvider) OnDemandLastUpdated() time.Time
- func (p *PricingProvider) OnDemandPrice(instanceType string) (float64, bool)
- func (p *PricingProvider) SpotLastUpdated() time.Time
- func (p *PricingProvider) SpotPrice(instanceType string, zone string) (float64, bool)
- type VPCLimits
Constants ¶
const ( InstanceTypesCacheKey = "types" InstanceTypeZonesCacheKeyPrefix = "zones:" InstanceTypesAndZonesCacheTTL = 5 * time.Minute )
const (
// MaxInstanceTypes defines the number of instance type options to pass to CreateFleet
MaxInstanceTypes = 60
)
Variables ¶
var Limits = map[string]*VPCLimits{}/* 560 elements not displayed */
VPC Limits and flags for ENI and IPv4 Addresses
Functions ¶
func NewInstanceType ¶ added in v0.19.0
func NewInstanceType(ctx context.Context, info *ec2.InstanceTypeInfo, kc *v1alpha5.KubeletConfiguration, region string, nodeTemplate *v1alpha1.AWSNodeTemplate, offerings cloudprovider.Offerings) *cloudprovider.InstanceType
func NewPricingAPI ¶ added in v0.19.0
func NewPricingAPI(sess *session.Session, region string) pricingiface.PricingAPI
NewPricingAPI returns a pricing API configured based on a particular region
Types ¶
type CloudProvider ¶
type CloudProvider struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.19.0
func New(ctx awscontext.Context) *CloudProvider
func (*CloudProvider) Create ¶
func (c *CloudProvider) Create(ctx context.Context, machine *v1alpha5.Machine) (*v1alpha5.Machine, error)
Create a machine given the constraints.
func (*CloudProvider) Delete ¶
TODO @joinnis: Migrate this delete call to use tag-based deleting when machine migration is done
func (*CloudProvider) Get ¶ added in v0.23.0
func (c *CloudProvider) Get(ctx context.Context, machineName, provisionerName string) (*v1alpha5.Machine, error)
TODO @joinnis: Remove provisionerName from this call signature once we decouple provisioner from GetInstanceTypes
func (*CloudProvider) GetInstanceTypes ¶
func (c *CloudProvider) GetInstanceTypes(ctx context.Context, provisioner *v1alpha5.Provisioner) ([]*cloudprovider.InstanceType, error)
GetInstanceTypes returns all available InstanceTypes
func (*CloudProvider) IsMachineDrifted ¶ added in v0.21.0
func (*CloudProvider) LivenessProbe ¶ added in v0.19.0
func (c *CloudProvider) LivenessProbe(req *http.Request) error
func (*CloudProvider) Name ¶ added in v0.5.3
func (c *CloudProvider) Name() string
Name returns the CloudProvider implementation name.
type CreateFleetBatcher ¶ added in v0.19.0
type CreateFleetBatcher struct {
// contains filtered or unexported fields
}
CreateFleetBatcher is used to batch CreateFleet calls from the cloud provider with identical parameters into a single call that launches more instances simultaneously.
func NewCreateFleetBatcher ¶ added in v0.19.0
func NewCreateFleetBatcher(ctx context.Context, ec2api ec2iface.EC2API) *CreateFleetBatcher
func (*CreateFleetBatcher) CreateFleet ¶ added in v0.19.0
func (b *CreateFleetBatcher) CreateFleet(ctx context.Context, createFleetInput *ec2.CreateFleetInput) (*ec2.CreateFleetOutput, error)
type InstanceProvider ¶ added in v0.19.0
type InstanceProvider struct {
// contains filtered or unexported fields
}
func NewInstanceProvider ¶ added in v0.19.0
func NewInstanceProvider(ctx context.Context, region string, ec2api ec2iface.EC2API, unavailableOfferings *cache.UnavailableOfferings, instanceTypeProvider *InstanceTypeProvider, subnetProvider *subnet.Provider, launchTemplateProvider *LaunchTemplateProvider) *InstanceProvider
func (*InstanceProvider) Create ¶ added in v0.19.0
func (p *InstanceProvider) Create(ctx context.Context, nodeTemplate *v1alpha1.AWSNodeTemplate, machine *v1alpha5.Machine, instanceTypes []*cloudprovider.InstanceType) (*ec2.Instance, error)
Create an instance given the constraints. instanceTypes should be sorted by priority for spot capacity type. If spot is not used, the instanceTypes are not required to be sorted because we are using ec2 fleet's lowest-price OD allocation strategy
func (*InstanceProvider) Delete ¶ added in v0.22.0
Delete deletes the machine based on machine name tag. It continues to do a Get followed by a Delete for machines until it receives an error (either a true error or a NotFound error). We do this because there is a tiny race that makes it possible for us to launch more than one instance for a Machine if EC2 is not read-after-write consistent and we perform another reconcile loop after doing a Create where the Get is not able to find the previous instance that we created.
func (*InstanceProvider) DeleteByID ¶ added in v0.23.0
func (p *InstanceProvider) DeleteByID(ctx context.Context, id string) error
type InstanceTypeProvider ¶ added in v0.19.0
func NewInstanceTypeProvider ¶ added in v0.19.0
func (*InstanceTypeProvider) List ¶ added in v0.22.0
func (p *InstanceTypeProvider) List(ctx context.Context, kc *v1alpha5.KubeletConfiguration, nodeTemplate *v1alpha1.AWSNodeTemplate) ([]*cloudprovider.InstanceType, error)
func (*InstanceTypeProvider) LivenessProbe ¶ added in v0.19.0
func (p *InstanceTypeProvider) LivenessProbe(req *http.Request) error
type LaunchTemplateProvider ¶ added in v0.19.0
func NewLaunchTemplateProvider ¶ added in v0.19.0
func (*LaunchTemplateProvider) EnsureAll ¶ added in v0.22.0
func (p *LaunchTemplateProvider) EnsureAll(ctx context.Context, nodeTemplate *v1alpha1.AWSNodeTemplate, machine *v1alpha5.Machine, instanceTypes []*cloudprovider.InstanceType, additionalLabels map[string]string) (map[string][]*cloudprovider.InstanceType, error)
func (*LaunchTemplateProvider) Invalidate ¶ added in v0.19.0
func (p *LaunchTemplateProvider) Invalidate(ctx context.Context, ltName string, ltID string)
Invalidate deletes a launch template from cache if it exists
type PricingProvider ¶ added in v0.19.0
type PricingProvider struct {
// contains filtered or unexported fields
}
PricingProvider provides actual pricing data to the AWS cloud provider to allow it to make more informed decisions regarding which instances to launch. This is initialized at startup with a periodically updated static price list to support running in locations where pricing data is unavailable. In those cases the static pricing data provides a relative ordering that is still more accurate than our previous pricing model. In the event that a pricing update fails, the previous pricing information is retained and used which may be the static initial pricing data if pricing updates never succeed.
func NewPricingProvider ¶ added in v0.19.0
func NewPricingProvider(ctx context.Context, pricing pricingiface.PricingAPI, ec2Api ec2iface.EC2API, region string, isolatedVPC bool, startAsync <-chan struct{}) *PricingProvider
func (*PricingProvider) InstanceTypes ¶ added in v0.19.0
func (p *PricingProvider) InstanceTypes() []string
InstanceTypes returns the list of all instance types for which either a spot or on-demand price is known.
func (*PricingProvider) LivenessProbe ¶ added in v0.19.0
func (p *PricingProvider) LivenessProbe(req *http.Request) error
func (*PricingProvider) OnDemandLastUpdated ¶ added in v0.19.0
func (p *PricingProvider) OnDemandLastUpdated() time.Time
OnDemandLastUpdated returns the time that the on-demand pricing was last updated
func (*PricingProvider) OnDemandPrice ¶ added in v0.19.0
func (p *PricingProvider) OnDemandPrice(instanceType string) (float64, bool)
OnDemandPrice returns the last known on-demand price for a given instance type, returning an error if there is no known on-demand pricing for the instance type.
func (*PricingProvider) SpotLastUpdated ¶ added in v0.19.0
func (p *PricingProvider) SpotLastUpdated() time.Time
SpotLastUpdated returns the time that the spot pricing was last updated
func (*PricingProvider) SpotPrice ¶ added in v0.19.0
func (p *PricingProvider) SpotPrice(instanceType string, zone string) (float64, bool)
SpotPrice returns the last known spot price for a given instance type and zone, returning an error if there is no known spot pricing for that instance type or zone