Documentation ¶
Index ¶
- type Controller
- func (c *Controller) OnAddNag(nag *assignmentsv1alpha1.NodeAssignmentGroup)
- func (c *Controller) OnAddNode(node *corev1.Node)
- func (c *Controller) OnDeleteNag(nag *assignmentsv1alpha1.NodeAssignmentGroup)
- func (c *Controller) OnDeleteNode(node *corev1.Node)
- func (c *Controller) OnUpdateNag(oldNag *assignmentsv1alpha1.NodeAssignmentGroup, ...)
- func (c *Controller) OnUpdateNode(oldNode *corev1.Node, newNode *corev1.Node)
- func (c *Controller) Run()
- type Manager
- type WriterContext
- func (wc *WriterContext) Reconcile() error
- func (wc *WriterContext) UnassignAllNodes() error
- func (wc *WriterContext) UnassignNodeByName(name string) error
- func (wc *WriterContext) Update()
- func (wc *WriterContext) UpdateNodeAssignment(node *corev1.Node, na *assignmentsv1alpha1.NodeAssignment) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller listens for changes to NodeAssignmentGroups and Nodes to reset allocation of nodes
func NewController ¶
func NewController(nagIndex cache.Indexer, nodeIndex cache.Indexer, kubeClient kubernetes.Interface, valetClient valet.Interface, threadiness int, stopChannel chan struct{}) *Controller
NewController creates a new Controller
func (*Controller) OnAddNag ¶
func (c *Controller) OnAddNag(nag *assignmentsv1alpha1.NodeAssignmentGroup)
OnAddNag process and added nag
func (*Controller) OnAddNode ¶
func (c *Controller) OnAddNode(node *corev1.Node)
OnAddNode queue all nags for processing.
func (*Controller) OnDeleteNag ¶
func (c *Controller) OnDeleteNag(nag *assignmentsv1alpha1.NodeAssignmentGroup)
OnDeleteNag if a nag was deleted process it
func (*Controller) OnDeleteNode ¶
func (c *Controller) OnDeleteNode(node *corev1.Node)
OnDeleteNode when a node is deleted process the applicable nag
func (*Controller) OnUpdateNag ¶
func (c *Controller) OnUpdateNag(oldNag *assignmentsv1alpha1.NodeAssignmentGroup, newNag *assignmentsv1alpha1.NodeAssignmentGroup)
OnUpdateNag if the nag has changed process it
func (*Controller) OnUpdateNode ¶
func (c *Controller) OnUpdateNode(oldNode *corev1.Node, newNode *corev1.Node)
OnUpdateNode recalculates all nags if targeting attributes have changed
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(kubeClient kubernetes.Interface, valetClient valet.Interface) *Manager
func (*Manager) AddFinalizer ¶
func (m *Manager) AddFinalizer(nag *assignmentsv1alpha1.NodeAssignmentGroup) (bool, error)
func (*Manager) ReconcileNag ¶
func (m *Manager) ReconcileNag(nag *assignmentsv1alpha1.NodeAssignmentGroup) error
ReconcileNag handles the business logic for NodeAssigmentGroup changes
func (*Manager) RemoveFinalizer ¶
func (m *Manager) RemoveFinalizer(nag *assignmentsv1alpha1.NodeAssignmentGroup) error
type WriterContext ¶
type WriterContext struct { Nag *assignmentsv1alpha1.NodeAssignmentGroup KnownAssignments map[string]struct{} TargetedNodes []*corev1.Node UntargetedNodes []*corev1.Node CurrentAssignments map[string]int AssignmentChanges map[string]int UnassignedNodeNames map[string]struct{} // contains filtered or unexported fields }
func NewWriterContext ¶
func NewWriterContext(kubeClientSet kubernetes.Interface, nag *assignmentsv1alpha1.NodeAssignmentGroup) *WriterContext
func (*WriterContext) Reconcile ¶
func (wc *WriterContext) Reconcile() error
func (*WriterContext) UnassignAllNodes ¶
func (wc *WriterContext) UnassignAllNodes() error
UnassignAllNodes cleans all nodes of assignment labels/taints This will effect any nodes that have label or taint for the group, Even if they no longer match the targetLabels Ensuring that deleting a group always removes ALL traces of the group from nodes
func (*WriterContext) UnassignNodeByName ¶
func (wc *WriterContext) UnassignNodeByName(name string) error
UnassignNodeByName get's the latest version of a node from the api and unassigns it
func (*WriterContext) Update ¶
func (wc *WriterContext) Update()
func (*WriterContext) UpdateNodeAssignment ¶
func (wc *WriterContext) UpdateNodeAssignment(node *corev1.Node, na *assignmentsv1alpha1.NodeAssignment) error
UpdateNodeAssignment uses the NodeAssignmentController's clients to do api updates