Skip to main content

AddTolerationsForExtendedResources

Adds tolerations to a PodSpec for extended resources requested by its containers. It identifies extended resources configured to require tolerations and applies a 'NoSchedule' toleration for each such resource to the pod.

def AddTolerationsForExtendedResources(
podSpec: *v1.PodSpec
) - > *v1.PodSpec

Adds tolerations to a Kubernetes PodSpec for extended resources requested by its containers. This ensures that pods requesting specific extended resources can be scheduled on nodes that are tainted with those resources.

Parameters

NameTypeDescription
podSpec*v1.PodSpecThe PodSpec to which tolerations will be added. If nil, a new empty PodSpec is created and returned.

Returns

TypeDescription
*v1.PodSpecThe modified PodSpec with added tolerations.