instancetype

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemoryAvailable = "memory.available"
	NodeFSAvailable = "nodefs.available"
)

Variables

View Source
var (
	InstanceTypeVCPU = opmetrics.NewPrometheusGauge(
		crmetrics.Registry,
		prometheus.GaugeOpts{
			Namespace: metrics.Namespace,
			Subsystem: cloudProviderSubsystem,
			Name:      "instance_type_cpu_cores",
			Help:      "VCPUs cores for a given instance type.",
		},
		[]string{
			instanceTypeLabel,
		},
	)
	InstanceTypeMemory = opmetrics.NewPrometheusGauge(
		crmetrics.Registry,
		prometheus.GaugeOpts{
			Namespace: metrics.Namespace,
			Subsystem: cloudProviderSubsystem,
			Name:      "instance_type_memory_bytes",
			Help:      "Memory, in bytes, for a given instance type.",
		},
		[]string{
			instanceTypeLabel,
		},
	)
	InstanceTypeOfferingAvailable = opmetrics.NewPrometheusGauge(
		crmetrics.Registry,
		prometheus.GaugeOpts{
			Namespace: metrics.Namespace,
			Subsystem: cloudProviderSubsystem,
			Name:      "instance_type_offering_available",
			Help:      "Instance type offering availability, based on instance type, capacity type, and zone",
		},
		[]string{
			instanceTypeLabel,
			capacityTypeLabel,
			zoneLabel,
		},
	)
	InstanceTypeOfferingPriceEstimate = opmetrics.NewPrometheusGauge(
		crmetrics.Registry,
		prometheus.GaugeOpts{
			Namespace: metrics.Namespace,
			Subsystem: cloudProviderSubsystem,
			Name:      "instance_type_offering_price_estimate",
			Help:      "Instance type offering estimated hourly price used when making informed decisions on node cost calculation, based on instance type, capacity type, and zone.",
		},
		[]string{
			instanceTypeLabel,
			capacityTypeLabel,
			zoneLabel,
		})
)
View Source
var (
	InstanceTypeBandwidthMegabits = map[string]int64{}/* 828 elements not displayed */

)
View Source
var Limits = map[string]*VPCLimits{}/* 840 elements not displayed */

VPC Limits and flags for ENI and IPv4 Addresses

Functions

func NewInstanceType

func NewInstanceType(ctx context.Context, info ec2types.InstanceTypeInfo, region string,
	blockDeviceMappings []*v1.BlockDeviceMapping, instanceStorePolicy *v1.InstanceStorePolicy, maxPods *int32, podsPerCore *int32,
	kubeReserved map[string]string, systemReserved map[string]string, evictionHard map[string]string, evictionSoft map[string]string,
	amiFamilyType string, offerings cloudprovider.Offerings) *cloudprovider.InstanceType

Types

type DefaultProvider added in v0.36.0

type DefaultProvider struct {
	// contains filtered or unexported fields
}

func NewDefaultProvider added in v0.36.0

func NewDefaultProvider(instanceTypesCache *cache.Cache, discoveredCapacityCache *cache.Cache, ec2api sdk.EC2API, subnetProvider subnet.Provider, instanceTypesResolver Resolver) *DefaultProvider

func (*DefaultProvider) List added in v0.36.0

func (*DefaultProvider) Reset added in v0.37.0

func (p *DefaultProvider) Reset()

func (*DefaultProvider) UpdateInstanceTypeCapacityFromNode added in v1.1.0

func (p *DefaultProvider) UpdateInstanceTypeCapacityFromNode(ctx context.Context, node *corev1.Node, nodeClaim *karpv1.NodeClaim, nodeClass *v1.EC2NodeClass) error

func (*DefaultProvider) UpdateInstanceTypeOfferings added in v0.37.0

func (p *DefaultProvider) UpdateInstanceTypeOfferings(ctx context.Context) error

func (*DefaultProvider) UpdateInstanceTypes added in v0.37.0

func (p *DefaultProvider) UpdateInstanceTypes(ctx context.Context) error

type DefaultResolver added in v1.1.0

type DefaultResolver struct {
	// contains filtered or unexported fields
}

func NewDefaultResolver added in v1.1.0

func NewDefaultResolver(region string, pricingProvider pricing.Provider, unavailableOfferingsCache *awscache.UnavailableOfferings) *DefaultResolver

func (*DefaultResolver) CacheKey added in v1.1.0

func (d *DefaultResolver) CacheKey(nodeClass *v1.EC2NodeClass) string

func (*DefaultResolver) Resolve added in v1.1.0

type NetworkCard

type NetworkCard struct {
	// max number of interfaces supported per card
	MaximumNetworkInterfaces int64
	// the index of current card
	NetworkCardIndex   int64
	NetworkPerformance string
}

type Provider

type Provider interface {
	List(context.Context, *v1.EC2NodeClass) ([]*cloudprovider.InstanceType, error)
}

type Resolver added in v1.1.0

type Resolver interface {
	// CacheKey tells the InstanceType cache if something changes about the InstanceTypes or Offerings based on the NodeClass.
	CacheKey(nodeClass *v1.EC2NodeClass) string
	// Resolve generates an InstanceType based on raw InstanceTypeInfo and NodeClass setting data
	Resolve(ctx context.Context, info ec2types.InstanceTypeInfo, zoneData []ZoneData, nodeClass *v1.EC2NodeClass) *cloudprovider.InstanceType
}

type VPCLimits

type VPCLimits struct {
	Interface               int
	IPv4PerInterface        int
	IsTrunkingCompatible    bool
	BranchInterface         int
	NetworkCards            []NetworkCard
	DefaultNetworkCardIndex int
	Hypervisor              string
	IsBareMetal             bool
}

type ZoneData added in v1.1.0

type ZoneData struct {
	Name      string
	ID        string
	Available bool
}

Jump to

Keyboard shortcuts

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