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
| Name | Type | Description |
|---|---|---|
| podSpec | *v1.PodSpec | The Kubernetes PodSpec to which GPU node selectors and tolerations will be applied. This object is modified directly. |
| gpuAccelerator | *core.GPUAccelerator | The GPU accelerator configuration, specifying the desired GPU device and partition size for the pod. |