Documentation ¶
Index ¶
- func AddOrUpdateDaemonPodTolerations(spec *v1.PodSpec, isCritical bool)
- func CreatePodTemplate(ns string, template v1.PodTemplateSpec, generation *int64, hash string) v1.PodTemplateSpec
- func GetTargetNodeName(pod *v1.Pod) (string, error)
- func GetTemplateGeneration(ds *apps.DaemonSet) (*int64, error)
- func IsPodUpdated(pod *v1.Pod, hash string, dsTemplateGeneration *int64) bool
- func ReplaceDaemonSetPodNodeNameNodeAffinity(affinity *v1.Affinity, nodename string) *v1.Affinity
- func SplitByAvailablePods(minReadySeconds int32, pods []*v1.Pod) ([]*v1.Pod, []*v1.Pod)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOrUpdateDaemonPodTolerations ¶
AddOrUpdateDaemonPodTolerations apply necessary tolerations to DeamonSet Pods, e.g. node.kubernetes.io/not-ready:NoExecute.
func CreatePodTemplate ¶ added in v1.7.0
func CreatePodTemplate(ns string, template v1.PodTemplateSpec, generation *int64, hash string) v1.PodTemplateSpec
CreatePodTemplate returns copy of provided template with additional label which contains templateGeneration (for backward compatibility), hash of provided template and sets default daemon tolerations.
func GetTargetNodeName ¶
GetTargetNodeName get the target node name of DaemonSet pods. If `.spec.NodeName` is not empty (nil), return `.spec.NodeName`; otherwise, retrieve node name of pending pods from NodeAffinity. Return error if failed to retrieve node name from `.spec.NodeName` and NodeAffinity.
func GetTemplateGeneration ¶ added in v1.10.0
GetTemplateGeneration gets the template generation associated with a v1.DaemonSet by extracting it from the deprecated annotation. If no annotation is found nil is returned. If the annotation is found and fails to parse nil is returned with an error. If the generation can be parsed from the annotation, a pointer to the parsed int64 value is returned.
func IsPodUpdated ¶
IsPodUpdated checks if pod contains label value that either matches templateGeneration or hash
func ReplaceDaemonSetPodNodeNameNodeAffinity ¶
ReplaceDaemonSetPodNodeNameNodeAffinity replaces the RequiredDuringSchedulingIgnoredDuringExecution NodeAffinity of the given affinity with a new NodeAffinity that selects the given nodeName. Note that this function assumes that no NodeAffinity conflicts with the selected nodeName.
Types ¶
This section is empty.