client

package
v0.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetActivePodsOnNode

func GetActivePodsOnNode(ctx context.Context, kubeClient kubernetes.Interface, nodeName string) ([]corev1.Pod, error)

func GetClientSet

func GetClientSet(mutations ...func(*rest.Config)) (*kubernetes.Clientset, error)

func GetKubeConfig

func GetKubeConfig(mutations ...func(*rest.Config)) (*rest.Config, error)

func InitKubeConfig

func InitKubeConfig(masterUrl, kubeconfig string) error

func MutationContentType

func MutationContentType(acceptContentTypes, contentType string) func(*rest.Config)

func MutationQPS

func MutationQPS(qps float32, burst int) func(*rest.Config)

func MutationUser

func MutationUser(userAgent string) func(*rest.Config)

func PatchNodeMetadata

func PatchNodeMetadata(kubeClient kubernetes.Interface, nodeName string, patchMetadata PatchMetadata) error

func PatchPodAllocationAllocating

func PatchPodAllocationAllocating(kubeClient kubernetes.Interface, pod *corev1.Pod) error

PatchPodAllocationAllocating patch pod metadata marking device allocation allocating.

func PatchPodAllocationFailed

func PatchPodAllocationFailed(kubeClient kubernetes.Interface, pod *corev1.Pod) error

PatchPodAllocationFailed patch pod metadata marking device allocation failed.

func PatchPodAllocationSucceed

func PatchPodAllocationSucceed(kubeClient kubernetes.Interface, pod *corev1.Pod) error

PatchPodAllocationSucceed patch pod metadata marking device allocation successful.

func PatchPodMetadata

func PatchPodMetadata(kubeClient kubernetes.Interface, pod *corev1.Pod, patchMetadata PatchMetadata) error

func PatchPodVGPUAnnotation

func PatchPodVGPUAnnotation(kubeClient kubernetes.Interface, pod *corev1.Pod) error

PatchPodVGPUAnnotation patch pod vGPU scheduling and allocation metadata.

Types

type PatchMetadata

type PatchMetadata struct {
	Annotations map[string]string `json:"annotations,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
}

type PodInfo

type PodInfo struct {
	PodName       string
	PodNamespace  string
	ContainerName string
}

type PodResource

type PodResource struct {
	sync.Mutex
	// contains filtered or unexported fields
}

PodResource implements the get pod resource info

func NewPodResource

func NewPodResource() *PodResource

NewPodResource returns an initialized PodResource

func (*PodResource) GetPodInfoByResourceDeviceIDs

func (pr *PodResource) GetPodInfoByResourceDeviceIDs(resp *v1alpha1.ListPodResourcesResponse,
	resourceName string, deviceIDs []string) (*PodInfo, error)

func (*PodResource) ListPodResource

func (pr *PodResource) ListPodResource() (*v1alpha1.ListPodResourcesResponse, error)

ListPodResource call pod resource List interface, get pod resource info

Jump to

Keyboard shortcuts

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