drainer

package
v0.0.0-...-82d568a Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeDrainer

type NodeDrainer struct {
	Node corev1.Node
	// contains filtered or unexported fields
}

NodeDrainer drains a kubernetes node

func NewNodeDrainer

func NewNodeDrainer(k8scli kubernetes.Interface, logger log.Logger, opts Options, node corev1.Node) *NodeDrainer

NewNodeDrainer initialises a new NodeDrainer

func (*NodeDrainer) DrainNode

func (nd *NodeDrainer) DrainNode() error

DrainNode drains a node in a cluster. Its process is as similar as reasonable to the one implemented by kubectl drain.

func (*NodeDrainer) SetCordonFn

func (nd *NodeDrainer) SetCordonFn(fn cordonFn) *NodeDrainer

SetCordonFn sets nd.supportEvictionFn for mocking

func (*NodeDrainer) SetDeletePodFn

func (nd *NodeDrainer) SetDeletePodFn(fn deletePodFn) *NodeDrainer

SetDeletePodFn sets nd.deletePodFn for mocking

func (*NodeDrainer) SetEvictPodFn

func (nd *NodeDrainer) SetEvictPodFn(fn evictPodFn) *NodeDrainer

SetEvictPodFn sets nd.evictPodFn for mocking

func (*NodeDrainer) SetGetPodFn

func (nd *NodeDrainer) SetGetPodFn(fn getPodFn) *NodeDrainer

SetGetPodFn sets nd.getPodFn for mocking

func (*NodeDrainer) SetGetPodsFn

func (nd *NodeDrainer) SetGetPodsFn(fn getPodsFn) *NodeDrainer

SetGetPodsFn sets nd.getPodsFn for mocking

func (*NodeDrainer) SetSupportEvictionFn

func (nd *NodeDrainer) SetSupportEvictionFn(fn supportEvictionFn) *NodeDrainer

SetSupportEvictionFn sets nd.supportEvictionFn for mocking

type Options

type Options struct {
	Timeout                time.Duration
	PodDeletionGracePeriod time.Duration
	UseEviction            bool
}

Options define the options for NodeDrainer

Jump to

Keyboard shortcuts

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