Taint Manager Source Code Analysis
The Taint Manager is triggered by pod and node events. It examines whether nodes bound to pods or nodes themselves have a “NoExecute” taint. If such taints are present, the Taint Manager proceeds to delete all pods on the affected node(s) or a specific pod.
In the previous article about the Node Lifecycle Controller, if the Taint Manager is enabled, it is initialized using NewNoExecuteTaintManager
.
Within the Node Lifecycle Controller, handlers are defined for pod and node events. When the Taint Manager is enabled, these events are added to the nodeUpdateQueue
and podUpdateQueue
within the Taint Manager.
Additionally, a goroutine is launched in the Node Lifecycle Controller to execute taintManager.Run(stopCh)
.