controllerutils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultNodePoolLabel = "kaiwo/nodepool"
)
View Source
var GPUTaint = corev1.Taint{
	Key:    common.DefaultGPUTaintKey,
	Value:  "true",
	Effect: corev1.TaintEffectNoSchedule,
}

Functions

func CalculateNumberOfReplicas

func CalculateNumberOfReplicas(ctx context.Context, k8sClient client.Client, gpuVendor string, totalUserRequestedGpus int, userReplicas int, userGpusPerReplica int, useAvailability bool) (int, int, int, error)

CalculateNumberOfReplicas determines the number of replicas and GPUs per replica based on node labels and optionally available GPU capacity.

func CompareClusterQueues

func CompareClusterQueues(a, b kueuev1beta1.ClusterQueue) bool

func ComparePriorityClasses

func ComparePriorityClasses(a, b kueuev1beta1.WorkloadPriorityClass) bool

func CompareResourceFlavors

func CompareResourceFlavors(a, b kueuev1beta1.ResourceFlavor) bool

func ConvertKaiwoToKueueClusterQueue

func ConvertKaiwoToKueueClusterQueue(kaiwoQueue v1alpha1.ClusterQueue) kueuev1beta1.ClusterQueue

func ConvertKaiwoToKueueResourceFlavor

func ConvertKaiwoToKueueResourceFlavor(kaiwoFlavor v1alpha1.ResourceFlavorSpec) kueuev1beta1.ResourceFlavor

func ConvertKaiwoToKueueResourceFlavors

func ConvertKaiwoToKueueResourceFlavors(kaiwoFlavors []v1alpha1.ResourceFlavorSpec) []kueuev1beta1.ResourceFlavor

func CreateClusterQueue

func CreateClusterQueue(nodePoolResources map[string]kueuev1beta1.FlavorQuotas, name string) v1alpha1.ClusterQueue

func CreateLocalQueue

func CreateLocalQueue(ctx context.Context, c client.Client, name string, namespace string) error

CreateLocalQueue creates a LocalQueue in the given namespace.

func EnsureNamespaceKueueManaged

func EnsureNamespaceKueueManaged(ctx context.Context, k8sClient client.Client, namespaceName string) error

func FindFlavor

func FindFlavor(flavors []kueuev1beta1.ResourceFlavor, name string) (kueuev1beta1.ResourceFlavor, bool)

func LabelNode

func LabelNode(ctx context.Context, c client.Client, nodeName, key, value string) error

func MapGPUDeviceIDToName

func MapGPUDeviceIDToName(gpuID string, vendor string) string

func RemoveDuplicateResourceFlavors

func RemoveDuplicateResourceFlavors(flavors []v1alpha1.ResourceFlavorSpec) []v1alpha1.ResourceFlavorSpec

func TaintNode

func TaintNode(ctx context.Context, client client.Client, nodeName string, taint corev1.Taint) error

Types

type NodeResourceInfo

type NodeResourceInfo struct {
	Name   string
	CPU    int
	Memory int
	Labels map[string]string
}

func GetNodeResources

func GetNodeResources(ctx context.Context, c client.Client) []NodeResourceInfo

Jump to

Keyboard shortcuts

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