provider

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstanceTypeInfo

type InstanceTypeInfo struct {
	// Storage (ephemeral) available (GiB).
	// Is 0 if not supported or none available.
	Storage int64
	// Max pods per node.
	MaxPodsPerNode int64
	// CPU count.
	CPU int64
}

InstanceTypeInfo holds minimal instance info required to calculate resources to reserve.

func NewInstanceTypeInfo

func NewInstanceTypeInfo(ec2info *ec2.InstanceTypeInfo) InstanceTypeInfo

NewInstanceTypeInfo creates a simple version of ec2.InstanceTypeInfo that provides functions to calculate defaults.

func (InstanceTypeInfo) DefaultCPUToReserve

func (i InstanceTypeInfo) DefaultCPUToReserve() string

DefaultCPUToReserve returns the millicores to reserve.

See https://github.com/awslabs/amazon-eks-ami/blob/ff690788dfaf399e6919eebb59371ee923617df4/files/bootstrap.sh#L183-L208 which takes it form https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#node_allocatable

6% of the first core 1% of the next core (up to 2 cores) 0.5% of the next 2 cores (up to 4 cores) 0.25% of any cores above 4 cores

func (InstanceTypeInfo) DefaultMemoryToReserve

func (i InstanceTypeInfo) DefaultMemoryToReserve() string

DefaultMemoryToReserve returns how much memory to reserve.

See https://github.com/awslabs/amazon-eks-ami/blob/21426e27e3845319dbca92e7df32e5c4b984a1d1/files/bootstrap.sh#L154-L165

func (InstanceTypeInfo) DefaultStorageToReserve

func (i InstanceTypeInfo) DefaultStorageToReserve() string

DefaultStorageToReserve returns how much storage to reserve.

See https://github.com/awslabs/amazon-eks-ami/blob/ff690788dfaf399e6919eebb59371ee923617df4/files/bootstrap.sh#L306 This is always 1GiB

Jump to

Keyboard shortcuts

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