drainer

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package drainer is mostly transplanted from kubectl See: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/drain/drain.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Drainer

type Drainer interface {
	Drain(nodeName string) error
}

Drainer represents the draining action

func New

func New(client kubernetes.Interface, options *Options) Drainer

New creates a new Drainer with the given Kubernetes client and options

type ErrWriter

type ErrWriter struct{}

ErrWriter allows for log usage inside kubectl drainer implementation

func (ErrWriter) Write

func (ErrWriter) Write(p []byte) (n int, err error)

type Options

type Options struct {
	Node                string
	Force               bool
	GracePeriodSeconds  int
	IgnoreAllDaemonSets bool
	Timeout             time.Duration
	DeleteLocalData     bool
	Selector            string
	PodSelector         string
	DrainDelay          time.Duration `mapstructure:"drain-delay"`
}

Options for the Drainer

func (*Options) String added in v0.0.3

func (o *Options) String() string

type OutWriter

type OutWriter struct{}

OutWriter allows for log usage inside kubectl drainer implementation

func (OutWriter) Write

func (OutWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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