instancetype

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0, Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemoryAvailable        = "memory.available"
	DefaultMemoryAvailable = "750Mi"
)
View Source
const (
	InstanceTypesCacheKey = "types"
	InstanceTypesCacheTTL = 23 * time.Hour
)

Variables

View Source
var (
	RestrictedVMSizes = sets.New(
		"Standard_A0",
		"Standard_A1",
		"Standard_A1_v2",
		"Standard_B1s",
		"Standard_B1ms",
		"Standard_F1",
		"Standard_F1s",
		"Basic_A0",
		"Basic_A1",
		"Basic_A2",
		"Basic_A3",
		"Basic_A4",
	)
)

Functions

func CalculateMemoryWithoutOverhead added in v0.7.0

func CalculateMemoryWithoutOverhead(vmMemoryOverheadPercent float64, skuMemoryGiB float64) *resource.Quantity

func EvictionThreshold

func EvictionThreshold() corev1.ResourceList

func KubeReservedResources

func KubeReservedResources(vcpus int64, memoryGib float64) corev1.ResourceList

func MaxEphemeralOSDiskSizeGB

func MaxEphemeralOSDiskSizeGB(sku *skewer.SKU) float64

MaxEphemeralOSDiskSizeGB returns the maximum ephemeral OS disk size for a given SKU. Ephemeral OS disk size is determined by the larger of the two values: 1. MaxResourceVolumeMB (Temp Disk Space) 2. MaxCachedDiskBytes (Cached Disk Space) For Ephemeral disk creation, CRP will use the larger of the two values to ensure we have enough space for the ephemeral disk. Note that generally only older SKUs use the Temp Disk space for ephemeral disks, and newer SKUs use the Cached Disk in most cases. The ephemeral OS disk is created with the free space of the larger of the two values in that place.

func NewInstanceType

func NewInstanceType(ctx context.Context, sku *skewer.SKU, vmsize *skewer.VMSizeType, kc *v1alpha2.KubeletConfiguration, region string,
	offerings cloudprovider.Offerings, nodeClass *v1alpha2.AKSNodeClass, architecture string) *cloudprovider.InstanceType

func SystemReservedResources

func SystemReservedResources() corev1.ResourceList

Types

type DefaultProvider added in v0.7.0

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

func NewDefaultProvider added in v0.7.0

func NewDefaultProvider(region string, cache *cache.Cache, skuClient skuclient.SkuClient, pricingProvider *pricing.Provider, offeringsCache *kcache.UnavailableOfferings) *DefaultProvider

func (*DefaultProvider) List added in v0.7.0

Get all instance type options

func (*DefaultProvider) LivenessProbe added in v0.7.0

func (p *DefaultProvider) LivenessProbe(req *http.Request) error

type Provider

type Provider interface {
	LivenessProbe(*http.Request) error
	List(context.Context, *v1alpha2.AKSNodeClass) ([]*cloudprovider.InstanceType, error)
}

type TaxBrackets

type TaxBrackets []struct {
	// UpperBound is the largest value this bracket is applied to.
	// The first bracket's lower bound is always 0.
	UpperBound float64

	// Rate is the percent rate of tax expressed as a float i.e. .5 for 50%.
	Rate float64
}

TaxBrackets implements a simple bracketed tax structure.

func (TaxBrackets) Calculate

func (t TaxBrackets) Calculate(amount float64) float64

Calculate expects Memory in Gi and CPU in cores.

Jump to

Keyboard shortcuts

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