Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeTaintHandler ¶
type NodeTaintHandler interface { // ApplyTaint taints the node with a special taint specified during object initialization. ApplyTaint() error // RemoveTaint untaints the node of a special taint specified during object initialization. RemoveTaint() error }
NodeTaintHandler is an abstract representation of objects that can taint or untaint a k8s node.
func NewNodeTaintHandler ¶
func NewNodeTaintHandler(taint *v1.Taint, annotation, node string, client *client.Clientset, recorder record.EventRecorder) NodeTaintHandler
type NodeTerminationHandler ¶
type NodeTerminationHandler interface { // Start runs the termination handler synchronously and returns error upon failure. Start() error }
NodeTerminationHandler is an abstract representation of objects that can handle node terminations gracefully.
func NewNodeTerminationHandler ¶
func NewNodeTerminationHandler( source NodeTerminationSource, taintHandler NodeTaintHandler, evictionHandler PodEvictionHandler, excludePods map[string]string) NodeTerminationHandler
type NodeTerminationSource ¶
type NodeTerminationSource interface { // WatchStart launches an internal goroutine that will watch for VM terminations and publish updates via an output channel WatchState() <-chan NodeTerminationState // GetState returns the current state of a node in terms of pending terminations. GetState() NodeTerminationState }
NodeTerminationSource is an abstract repsentation of objects that tracks impending terminations for a node.
func NewGCETerminationSource ¶
func NewGCETerminationSource(regularNodeTimeout time.Duration) (NodeTerminationSource, error)
type NodeTerminationState ¶
type NodeTerminationState struct { // NodeName is the hostname of the local node NodeName string // Set to true when a termination is impending for this node. PendingTermination bool // Aboslute time at which the node is expected to be terminated. TerminationTime time.Time // NeedsReboot indicates if a reboot is applicable to handle the pending termination. NeedsReboot bool }
NodeTerminationState represents the current status of a node in terms of terminations.
type PodEvictionHandler ¶
type PodEvictionHandler interface { // EvictPods deletes all pods except the ones included in `excludePods` // `excludePods` is a map where the key is pod name and value is pod namespace. // `timeout` is the overall time available to evict all pods. EvictPods(excludePods map[string]string, timeout time.Duration) error }
PodEvictionHandler is an abstract representation of objects that can delete pods from all namespaces running on a specified node.
func NewPodEvictionHandler ¶
func NewPodEvictionHandler(node string, client *client.Clientset, recorder record.EventRecorder, systemPodGracePeriod time.Duration) PodEvictionHandler
List all pods on the node Evict all pods on the node not in kube-system namespace Return nil on success