kwok

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Scheme Labels
	Group = "karpenter.kwok.sh"

	// Labels that can be selected on and are propagated to the node
	InstanceSizeLabelKey   = Group + "/instance-size"
	InstanceFamilyLabelKey = Group + "/instance-family"
	InstanceMemoryLabelKey = Group + "/instance-memory"
	InstanceCPULabelKey    = Group + "/instance-cpu"
)

Variables

View Source
var (
	KwokZones      = []string{"test-zone-a", "test-zone-b", "test-zone-c", "test-zone-d"}
	KwokPartitions = []string{"partition-a", "partition-b", "partition-c", "partition-d", "partition-e",
		"partition-f", "partition-g", "partition-h", "partition-i", "partition-j"}
)

Hard coded Kwok values

Functions

func ConstructInstanceTypes

func ConstructInstanceTypes() []*cloudprovider.InstanceType

InstanceTypesAssorted create many unique instance types with varying CPU/memory/architecture/OS/zone/capacity type.

func MakeInstanceTypeLabels

func MakeInstanceTypeLabels(cpu, memFactor int) map[string]string

func PriceFromResources

func PriceFromResources(resources v1.ResourceList) float64

Types

type CloudProvider

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

func NewCloudProvider

func NewCloudProvider(ctx context.Context, kubeClient client.Client, instanceTypes []*cloudprovider.InstanceType) *CloudProvider

func (CloudProvider) Create

func (c CloudProvider) Create(ctx context.Context, nodeClaim *v1beta1.NodeClaim) (*v1beta1.NodeClaim, error)

func (CloudProvider) Delete

func (c CloudProvider) Delete(ctx context.Context, nodeClaim *v1beta1.NodeClaim) error

func (CloudProvider) Get

func (c CloudProvider) Get(ctx context.Context, providerID string) (*v1beta1.NodeClaim, error)

func (CloudProvider) GetInstanceTypes

func (c CloudProvider) GetInstanceTypes(ctx context.Context, nodePool *v1beta1.NodePool) ([]*cloudprovider.InstanceType, error)

Return the hard-coded instance types.

func (CloudProvider) IsDrifted

func (c CloudProvider) IsDrifted(ctx context.Context, nodeClaim *v1beta1.NodeClaim) (cloudprovider.DriftReason, error)

Return nothing since there's no cloud provider drift.

func (CloudProvider) List

func (c CloudProvider) List(ctx context.Context) ([]*v1beta1.NodeClaim, error)

func (CloudProvider) Name

func (c CloudProvider) Name() string

type InstanceTypeOptions

type InstanceTypeOptions struct {
	Name               string
	Offerings          cloudprovider.Offerings
	Architecture       string
	OperatingSystems   sets.Set[string]
	Resources          v1.ResourceList
	InstanceTypeLabels map[string]string
}

Jump to

Keyboard shortcuts

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