Documentation
¶
Index ¶
- func CalculateNumberOfReplicas(requestedGpus int, gpusPerNode int, envVars []corev1.EnvVar) (int, int)
- func GetClient() (client.Client, error)
- func GetClientset() (*kubernetes.Clientset, error)
- func GetClusterQueue(ctx context.Context, k8sClient client.Client, clusterQueueName string) (*kueuev1beta1.ClusterQueue, error)
- func GetDefaultResourceFlavorGpuCount(ctx context.Context, k8sClient client.Client, labelKey string) (int, error)
- func GetDynamicClient() (dynamic.Interface, error)
- func GetKubeConfig() (string, error)
- func GetResourceFlavorGpuCount(resourceFlavor kueuev1beta1.ResourceFlavor, labelKey string) (int, error)
- func GetScheme() (runtime.Scheme, error)
- func InitializeDynamicClient() (dynamic.Interface, error)
- func ListResourceFlavorsWithNodeLabel(ctx context.Context, k8sClient client.Client, labelKey string) ([]kueuev1beta1.ResourceFlavor, error)
- func MinimalizeAndConvertToYAML(s *runtime.Scheme, obj runtime.Object) (string, error)
- func PrepareLocalClusterQueue(ctx context.Context, queueName string, namespace string, ...) (*kueuev1beta1.LocalQueue, error)
- type EnvVarInput
- type KubernetesClients
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateNumberOfReplicas ¶
func CalculateNumberOfReplicas(requestedGpus int, gpusPerNode int, envVars []corev1.EnvVar) (int, int)
CalculateNumberOfReplicas attempts to balance the number of replicas by maximizing the number of GPUs used per node
func GetClientset ¶
func GetClientset() (*kubernetes.Clientset, error)
func GetClusterQueue ¶
func GetClusterQueue(ctx context.Context, k8sClient client.Client, clusterQueueName string) (*kueuev1beta1.ClusterQueue, error)
func GetDynamicClient ¶
GetDynamicClient provides a singleton for the dynamic client
func GetKubeConfig ¶
GetKubeConfig loads the kubeconfig file path
func GetResourceFlavorGpuCount ¶
func GetResourceFlavorGpuCount(resourceFlavor kueuev1beta1.ResourceFlavor, labelKey string) (int, error)
func InitializeDynamicClient ¶
InitializeDynamicClient initializes the dynamic Kubernetes client
func ListResourceFlavorsWithNodeLabel ¶
func ListResourceFlavorsWithNodeLabel(ctx context.Context, k8sClient client.Client, labelKey string) ([]kueuev1beta1.ResourceFlavor, error)
func MinimalizeAndConvertToYAML ¶
MinimalizeAndConvertToYAML converts a runtime.Object or client.Object to its YAML representation while removing read-only fields like `metadata.creationTimestamp`, `status`, and others.
func PrepareLocalClusterQueue ¶
func PrepareLocalClusterQueue(ctx context.Context, queueName string, namespace string, k8sClient client.Client) (*kueuev1beta1.LocalQueue, error)
Types ¶
type EnvVarInput ¶
type EnvVarInput struct {
Name string `yaml:"name,omitempty"`
Value string `yaml:"value,omitempty"`
FromSecret *struct {
Name string `yaml:"name"`
Secret string `yaml:"secret"`
Key string `yaml:"key"`
} `yaml:"fromSecret,omitempty"`
MountSecret *struct {
Name string `yaml:"name"`
Secret string `yaml:"secret"`
Key string `yaml:"key"`
Path string `yaml:"path"`
} `yaml:"mountSecret,omitempty"`
}
type KubernetesClients ¶
type KubernetesClients struct {
Client client.Client
Clientset *kubernetes.Clientset
Kubeconfig *rest.Config
}
func GetKubernetesClients ¶
func GetKubernetesClients() (*KubernetesClients, error)
Click to show internal directories.
Click to hide internal directories.