resources

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

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

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

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

Index

Constants

View Source
const (
	LabelKeyNvidia          = "accelerator"
	LabelValueNvidia        = "nvidia"
	CapacityNvidiaGPU       = "nvidia.com/gpu"
	GPUProvisionerNamespace = "gpu-provisioner"
	GPUString               = "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 GenerateDeploymentManifest

func GenerateDeploymentManifest(ctx context.Context, workspaceObj *kaitov1alpha1.Workspace, imageName string,
	imagePullSecretRefs []corev1.LocalObjectReference, replicas int, commands []string, containerPorts []corev1.ContainerPort,
	livenessProbe, readinessProbe *corev1.Probe, resourceRequirements corev1.ResourceRequirements,
	tolerations []corev1.Toleration, volumes []corev1.Volume, volumeMount []corev1.VolumeMount) *appsv1.Deployment

func GenerateDeploymentManifestWithPodTemplate

func GenerateDeploymentManifestWithPodTemplate(ctx context.Context, workspaceObj *kaitov1alpha1.Workspace, tolerations []corev1.Toleration) *appsv1.Deployment

func GenerateHeadlessServiceManifest

func GenerateHeadlessServiceManifest(ctx context.Context, workspaceObj *kaitov1alpha1.Workspace) *corev1.Service

func GenerateServiceManifest

func GenerateServiceManifest(ctx context.Context, workspaceObj *kaitov1alpha1.Workspace, serviceType corev1.ServiceType, isStatefulSet bool) *corev1.Service

func GenerateStatefulSetManifest

func GenerateStatefulSetManifest(ctx context.Context, workspaceObj *kaitov1alpha1.Workspace, imageName string,
	imagePullSecretRefs []corev1.LocalObjectReference, replicas int, commands []string, containerPorts []corev1.ContainerPort,
	livenessProbe, readinessProbe *corev1.Probe, resourceRequirements corev1.ResourceRequirements,
	tolerations []corev1.Toleration, volumes []corev1.Volume, volumeMount []corev1.VolumeMount) *appsv1.StatefulSet

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