Skip to main content

GetPodTolerations

Retrieves a list of Kubernetes tolerations for a pod based on whether it is interruptible and its resource requirements. It aggregates tolerations from configured resource-specific, interruptible, and default settings.

def GetPodTolerations(
interruptible: bool,
resourceRequirements: ...v1.ResourceRequirements
) - > []v1.Toleration

Retrieves a list of Kubernetes tolerations for a pod based on whether it is interruptible and its resource requirements. This function aggregates tolerations from various sources to ensure the pod can be scheduled appropriately.

Parameters

NameTypeDescription
interruptibleboolA boolean flag indicating whether the pod is interruptible. If true, specific tolerations for interruptible pods will be included.
resourceRequirements...v1.ResourceRequirementsA variadic slice of Kubernetes resource requirements for the pod. Tolerations associated with these requested resources (limits and requests) will be included.

Returns

TypeDescription
[]v1.TolerationA slice of Kubernetes toleration objects applicable to the pod.