k8s

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorDrainIsLocked

func NewErrorDrainIsLocked() error

func NewErrorDrainTimeoutSecondsInvalid added in v1.5.0

func NewErrorDrainTimeoutSecondsInvalid() error

func NewErrorFailedToEvictAllPods

func NewErrorFailedToEvictAllPods() error

func NewErrorInvalidLease added in v1.5.0

func NewErrorInvalidLease() error

func NewLease added in v1.5.0

func NewLease(name string, client client.LeaseInterface) *lease

Create a new lease instance. Does not create a lease on the kubernetes side.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config Config) (*Client, error)

Create a new kubernetes client, defaults to in-cluster if no kubeconfig is provided

func NewFakeClient

func NewFakeClient() (*Client, *fake.Clientset)

Create a test client with a fake kubernetes clientset

func (*Client) DrainNode

func (c *Client) DrainNode(node string) error

Drain a node from all pods and set it to unschedulable. Status will be tracked in lease, only one drain will be run at a time.

func (*Client) FindNodeByZincatiID

func (c *Client) FindNodeByZincatiID(zincatiID string) (string, error)

Find the node in the cluster with the matching machine id

func (*Client) IsDrained

func (c *Client) IsDrained(node string) (bool, error)

Check if a node has been drained

func (*Client) UncordonNode

func (c *Client) UncordonNode(node string) error

Uncordon a node

type Config added in v1.5.0

type Config struct {
	Kubeconfig          string `yaml:"kubeconfig,omitempty"`
	DrainTimeoutSeconds int32  `yaml:"drainTimeoutSeconds,omitempty"`
	DrainRetries        int    `yaml:"drainRetries,omitempty"`
}

func NewDefaultConfig added in v1.5.0

func NewDefaultConfig() Config

type ErrorDrainIsLocked

type ErrorDrainIsLocked struct{}

func (ErrorDrainIsLocked) Error

func (e ErrorDrainIsLocked) Error() string

type ErrorDrainTimeoutSecondsInvalid added in v1.5.0

type ErrorDrainTimeoutSecondsInvalid struct{}

func (ErrorDrainTimeoutSecondsInvalid) Error added in v1.5.0

type ErrorFailedToEvictAllPods

type ErrorFailedToEvictAllPods struct{}

func (ErrorFailedToEvictAllPods) Error

type ErrorInvalidLease added in v1.5.0

type ErrorInvalidLease struct{}

func (ErrorInvalidLease) Error added in v1.5.0

func (e ErrorInvalidLease) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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