Skip to main content

ApplyGPUNodeSelectors

Applies GPU node selectors and tolerations to a pod's specification based on the provided GPU accelerator configuration, modifying the pod's affinity and tolerations.

def ApplyGPUNodeSelectors(
podSpec: *v1.PodSpec,
gpuAccelerator: *core.GPUAccelerator
)

Applies GPU-related node selectors and tolerations to a given PodSpec based on the provided GPU accelerator configuration. This function modifies the PodSpec in place to ensure the pod is scheduled on nodes with the specified GPU device and partition size.

Parameters

NameTypeDescription
podSpec*v1.PodSpecThe Kubernetes PodSpec to which GPU node selectors and tolerations will be applied. This object is modified directly.
gpuAccelerator*core.GPUAcceleratorThe GPU accelerator configuration, specifying the desired GPU device and partition size for the pod.