Documentation ¶
Index ¶
- Constants
- func AllCSINodeDriversAreReady(log logr.Logger, recorder record.EventRecorder, node *corev1.Node, ...) bool
- func AllNodeCriticalDaemonPodsAreScheduled(log logr.Logger, recorder record.EventRecorder, node *corev1.Node, ...) bool
- func AllNodeCriticalPodsAreReady(log logr.Logger, recorder record.EventRecorder, node *corev1.Node, ...) bool
- func GetExistingDriversFromCSINode(ctx context.Context, client client.Client, csiNodeName types.NamespacedName) (sets.Set[string], error)
- func GetRequiredDrivers(pods []corev1.Pod) sets.Set[string]
- func NodeHasCriticalComponentsNotReadyTaint(obj client.Object) bool
- func RemoveTaint(ctx context.Context, w client.Writer, node *corev1.Node) error
- type Reconciler
Constants ¶
const ControllerName = "node"
ControllerName is the name of the controller.
Variables ¶
This section is empty.
Functions ¶
func AllCSINodeDriversAreReady ¶ added in v1.67.0
func AllCSINodeDriversAreReady(log logr.Logger, recorder record.EventRecorder, node *corev1.Node, requiredDrivers, existingDrivers sets.Set[string]) bool
AllCSINodeDriversAreReady compares a set of required drivers (i.e. drivers that are specified by csi-driver-node pods) with a set of existing drivers (i.e. drivers for which the CSINode object had information stored in spec). Either set could be empty.
func AllNodeCriticalDaemonPodsAreScheduled ¶
func AllNodeCriticalDaemonPodsAreScheduled(log logr.Logger, recorder record.EventRecorder, node *corev1.Node, daemonSets []appsv1.DaemonSet, nodeCriticalPods []corev1.Pod) bool
AllNodeCriticalDaemonPodsAreScheduled returns true if all node-critical DaemonSets that should be scheduled to the given node have been scheduled. It uses ownerReferences of the given node-critical pods on the node for this check.
func AllNodeCriticalPodsAreReady ¶
func AllNodeCriticalPodsAreReady(log logr.Logger, recorder record.EventRecorder, node *corev1.Node, nodeCriticalPods []corev1.Pod) bool
AllNodeCriticalPodsAreReady returns true if all the given pods are ready by checking their Ready conditions.
func GetExistingDriversFromCSINode ¶ added in v1.67.0
func GetExistingDriversFromCSINode(ctx context.Context, client client.Client, csiNodeName types.NamespacedName) (sets.Set[string], error)
GetExistingDriversFromCSINode returns a set of all driver names that are present in the CSINode object. A non-existent CSINode object is not considered an error, an empty set of existing drivers is returned instead.
func GetRequiredDrivers ¶ added in v1.67.0
GetRequiredDrivers searches through the pods annotations, and returns a set of driver names if it finds annotations with the wait-for-csi-node prefix; otherwise it returns an empty set.
func NodeHasCriticalComponentsNotReadyTaint ¶
NodeHasCriticalComponentsNotReadyTaint returns true if the given Node has the taint that this controller manages.
Types ¶
type Reconciler ¶
type Reconciler struct { TargetClient client.Client Config config.NodeControllerConfig Recorder record.EventRecorder }
Reconciler manages taints on new Node objects to block scheduling of user workload pods until all node critical components are ready.
func (*Reconciler) AddToManager ¶
AddToManager adds Reconciler to the given manager.
func (*Reconciler) NodePredicate ¶
func (r *Reconciler) NodePredicate() predicate.Predicate
NodePredicate returns a predicate that filters for Node objects that are created with the taint.