nodeassignment

package
v0.0.0-...-f0ef8f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

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

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

func (*Controller) Run

func (c *Controller) Run()

Run starts the nodeassignment.Controller

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 (*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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL