resources

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Index

Constants

View Source
const (
	LabelKeyNvidia    = "accelerator"
	LabelValueNvidia  = "nvidia"
	CapacityNvidiaGPU = "nvidia.com/gpu"
)

Variables

This section is empty.

Functions

func CheckNvidiaPlugin

func CheckNvidiaPlugin(ctx context.Context, nodeObj *corev1.Node) bool

func CheckResourceStatus

func CheckResourceStatus(obj client.Object, kubeClient client.Client, timeoutDuration time.Duration) error

func CreateResource

func CreateResource(ctx context.Context, resource client.Object, kubeClient client.Client) error

func ExtractObjFields

func ExtractObjFields(obj interface{}) (instanceType, namespace, name string, labelSelector *metav1.LabelSelector,
	nameLabel, namespaceLabel string, err error)

func GetNode

func GetNode(ctx context.Context, nodeName string, kubeClient client.Client) (*corev1.Node, error)

GetNode get kubernetes node object with a provided name

func GetResource

func GetResource(ctx context.Context, name, namespace string, kubeClient client.Client, resource client.Object) error

func ListNodes

func ListNodes(ctx context.Context, kubeClient client.Client, labelSelector client.MatchingLabels) (*corev1.NodeList, error)

ListNodes get list of kubernetes nodes

func UpdateNodeWithLabel

func UpdateNodeWithLabel(ctx context.Context, nodeName, labelKey, labelValue string, kubeClient client.Client) error

UpdateNodeWithLabel update the node object with the label key/value

Types

This section is empty.

Jump to

Keyboard shortcuts

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