Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIProvider ¶
type APIProvider interface { Run(<-chan struct{}) DesiredGroupSize(string) (int, error) OutdatedLaunchConfig(*config.Ops, *core_v1.Node) (bool, error) PreDrain(*config.Ops, *core_v1.Node) error DetachNode(*config.Ops, *core_v1.Node) error }
APIProvider handles the provider-specific API requests needed for getting the needed instanceGroupsize and any provider-specific drain logic
type Deleter ¶
type Deleter struct {
// contains filtered or unexported fields
}
Deleter handles the actual deletion logic
func New ¶
func New(opts *config.Ops, controller *controller.Controller, provider APIProvider, stateMap *configmap.ConfigMap, metrics *metrics.Reporter) *Deleter
New creates the deleter
func (*Deleter) Run ¶
func (d *Deleter) Run(stopCh <-chan struct{})
Run starts the deleter deleting nodes
func (*Deleter) StateTransitionFunction ¶
StateTransitionFunction makes the needed decisions and API calls to move a node between states
func (*Deleter) WantToDelete ¶
WantToDelete determines whether the controller wants delete the node and returns the reason why if it does The clauses are ordered the way they are for metrics reasons, ie if a node is both too old and has outdated config, we probably want to report the outdated config, rather than the age
type Group ¶
type Group struct { Name string Key string IsReal bool MaxSurge int DeletionSchedule *cron.Schedule NumDesired int Nodes map[string]*NodeState PriorityNodes map[string]struct{} }
Group represents the deletion states and settings for a single group
func (*Group) Advance ¶
func (g *Group) Advance(f StateTransitionFunction)
Advance tries to move as many nodes in the group as possible to deletion
type GroupStates ¶
GroupStates represents a set of state machines describing the progress in deleting nodes from each group
func (*GroupStates) Advance ¶
func (gs *GroupStates) Advance(f StateTransitionFunction)
Advance tries to advance deletion for all groups, in parallel
func (*GroupStates) Debug ¶
func (gs *GroupStates) Debug()
Debug outputs some quick stats about each groups' state
func (*GroupStates) SerializeState ¶
func (gs *GroupStates) SerializeState() SerializedState
SerializeState extracts the basic information about node states to a separate struct
type NodeState ¶
type NodeState struct { Name string `json:"-"` State State `json:"state"` CreationTime meta_v1.Time `json:"-"` NeverDelete bool `json:"-"` }
NodeState represents the state of deletion for a single node
type SerializedState ¶
SerializedState is a snapshot of the deletion state for every node. Can be serialized to and from a configmap.
type State ¶
type State string
State is an enumeration of the stages of the deletion process
const ( // DontWantDelete means the controller doesn't want to delete the node DontWantDelete State = "dont_want_delete" // WantDelete means the controller does want to delete the node, but hasn't started yet WantDelete State = "want_delete" // Detached means the controller has detached the node from the underlying ASG, and is waiting for overprovision before deleting Detached State = "detached" // ReadyToDelete means the controller is ready to actually begin deleting a node ReadyToDelete State = "ready_to_delete" // Deleting means the controller has instructed nodereaperd to delete the node Deleting State = "deleting" )