kubernetesk8s.io/kubernetes/pkg/kubectl/cmd/drain Index | Files

package drain

import "k8s.io/kubernetes/pkg/kubectl/cmd/drain"

Index

Constants

const (
	EvictionKind        = "Eviction"
	EvictionSubresource = "pods/eviction"
)

Functions

func NewCmdCordon

func NewCmdCordon(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

func NewCmdDrain

func NewCmdDrain(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

func NewCmdUncordon

func NewCmdUncordon(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

func SupportEviction

func SupportEviction(clientset kubernetes.Interface) (string, error)

SupportEviction uses Discovery API to find out if the server support eviction subresource If support, it will return its groupVersion; Otherwise, it will return ""

Types

type DrainOptions

type DrainOptions struct {
	PrintFlags *genericclioptions.PrintFlags
	ToPrinter  func(string) (printers.ResourcePrinterFunc, error)

	Namespace string

	Force              bool
	DryRun             bool
	GracePeriodSeconds int
	IgnoreDaemonsets   bool
	Timeout            time.Duration
	DeleteLocalData    bool
	Selector           string
	PodSelector        string

	genericclioptions.IOStreams
	// contains filtered or unexported fields
}

func NewDrainOptions

func NewDrainOptions(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *DrainOptions

func (*DrainOptions) Complete

func (o *DrainOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

Complete populates some fields from the factory, grabs command line arguments and looks up the node using Builder

func (*DrainOptions) RunCordonOrUncordon

func (o *DrainOptions) RunCordonOrUncordon(desired bool) error

RunCordonOrUncordon runs either Cordon or Uncordon. The desired value for "Unschedulable" is passed as the first arg.

func (*DrainOptions) RunDrain

func (o *DrainOptions) RunDrain() error

RunDrain runs the 'drain' command

Source Files

drain.go

Version
v1.13.2
Published
Jan 9, 2019
Platform
js/wasm
Imports
28 packages
Last checked
4 minutes ago

Tools for package owners.