utils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelNodePoolKey     string = "karpenter.sh/nodepool"
	LabelGCENodeClassKey string = "karpenter.k8s.gcp/gcenodeclass"
	LabelClusterNameKey  string = "goog-k8s-cluster-name"
)

Variables

This section is empty.

Functions

func GetAllSingleValuedRequirementLabels

func GetAllSingleValuedRequirementLabels(instanceType *cloudprovider.InstanceType) map[string]string

func Hash

func Hash(str string) string

func ResolveNodePoolFromNodeClaim

func ResolveNodePoolFromNodeClaim(ctx context.Context, kubeClient client.Client, nodeClaim *karpv1.NodeClaim) (*karpv1.NodePool, error)

func ResolveReservedCPUMCore

func ResolveReservedCPUMCore(instanceType string, cpuMCore int64) int64

func ResolveReservedEphemeralStorage

func ResolveReservedEphemeralStorage(bootDiskGiB, totalSSDGiB, localSSDCount int64) (int64, int64)

func ResolveReservedMemoryMiB

func ResolveReservedMemoryMiB(instanceType string, memoryMiB int64) int64

func ResolveReservedResource

func ResolveReservedResource(instanceType string, cpuMCore, memoryMiB, bootDiskGiB, totalSSDGiB, localSSDCount int64) (int64, int64, int64, int64, int64)

func SanitizeGCELabelValue

func SanitizeGCELabelValue(s string) string

func WithDefaultFloat64

func WithDefaultFloat64(key string, def float64) float64

WithDefaultFloat64 returns the float64 value of the supplied environment variable or, if not present, the supplied default value. If the float64 conversion fails, returns the default

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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