Documentation ¶
Index ¶
- Constants
- type Node
- func (n Node) Drain() error
- func (n Node) GetEventID() (string, error)
- func (n Node) IsLabeledWithAction() (bool, error)
- func (n Node) IsUnschedulable() (bool, error)
- func (n Node) MarkForUncordonAfterReboot() error
- func (n Node) MarkWithEventID(eventID string) error
- func (n Node) RemoveNTHLabels() error
- func (n Node) Uncordon() error
- func (n Node) UncordonIfRebooted() error
Constants ¶
const ( // UncordonAfterRebootLabelVal is a k8s label value that can added to an action label to uncordon a node UncordonAfterRebootLabelVal = "UncordonAfterReboot" // ActionLabelKey is a k8s label key that can be added to the k8s node NTH is running on ActionLabelKey = "aws-node-termination-handler/action" // ActionLabelTimeKey is a k8s label key whose value is the secs since the epoch when an action label is added ActionLabelTimeKey = "aws-node-termination-handler/action-time" // EventIDLabelKey is a k8s label key whose value is the drainable event id EventIDLabelKey = "aws-node-termination-handler/event-id" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a kubernetes node with functions to manipulate its state via the kubernetes api server
func New ¶
New will construct a node struct to perform various node function through the kubernetes api server
func NewWithValues ¶ added in v1.3.0
NewWithValues will construct a node struct with a drain helper
func (Node) GetEventID ¶
GetEventID will retrieve the event ID valude from the node label
func (Node) IsLabeledWithAction ¶
IsLabeledWithAction will return true if the current node is labeled with NTH action labels
func (Node) IsUnschedulable ¶
IsUnschedulable checks if the node is marked as unschedulable
func (Node) MarkForUncordonAfterReboot ¶
MarkForUncordonAfterReboot adds labels to the kubernetes node which NTH will read upon reboot
func (Node) MarkWithEventID ¶
MarkWithEventID will add the drain event ID to the node to be properly ignored after a system restart event
func (Node) RemoveNTHLabels ¶
RemoveNTHLabels will remove all the custom NTH labels added to the node
func (Node) UncordonIfRebooted ¶
UncordonIfRebooted will check for node labels to trigger an uncordon because of a system-reboot scheduled event