kubernetes

package
v1.2.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DrainTimeout is maximum time to wait for the node to be drained.
	DrainTimeout = 5 * time.Minute
)

Variables

This section is empty.

Functions

func IsRetryableError added in v0.10.0

func IsRetryableError(err error) bool

IsRetryableError returns true if this Kubernetes API should be retried.

func NewDialer added in v0.14.0

func NewDialer() *connrotation.Dialer

NewDialer creates new custom dialer.

Types

type Client added in v0.3.0

type Client struct {
	*kubernetes.Clientset
	// contains filtered or unexported fields
}

Client represents a set of helper methods for interacting with the Kubernetes API.

func NewClientFromKubeletKubeconfig added in v0.3.0

func NewClientFromKubeletKubeconfig() (client *Client, err error)

NewClientFromKubeletKubeconfig initializes and returns a Client.

func NewClientFromPKI added in v0.3.0

func NewClientFromPKI(ca, crt, key []byte, endpoint *url.URL) (client *Client, err error)

NewClientFromPKI initializes and returns a Client.

func NewForConfig added in v0.3.0

func NewForConfig(config *restclient.Config) (client *Client, err error)

NewForConfig initializes and returns a client using the provided config.

func NewTemporaryClientFromPKI added in v0.3.0

func NewTemporaryClientFromPKI(ca *x509.PEMEncodedCertificateAndKey, endpoint *url.URL) (client *Client, err error)

NewTemporaryClientFromPKI initializes a Kubernetes client using a certificate with a TTL of 10 minutes.

func (*Client) Close added in v0.11.0

func (h *Client) Close() error

Close all connections.

func (*Client) Cordon added in v0.3.0

func (h *Client) Cordon(ctx context.Context, name string) error

Cordon marks a node as unschedulable.

func (*Client) CordonAndDrain added in v0.3.0

func (h *Client) CordonAndDrain(ctx context.Context, node string) (err error)

CordonAndDrain cordons and drains a node in one call.

func (*Client) Drain added in v0.3.0

func (h *Client) Drain(ctx context.Context, node string) error

Drain evicts all pods on a given node.

func (*Client) LabelNodeAsMaster added in v0.3.0

func (h *Client) LabelNodeAsMaster(ctx context.Context, name string, taintNoSchedule bool) (err error)

LabelNodeAsMaster labels a node with the required master label and NoSchedule taint.

func (*Client) NodeIPs added in v0.9.0

func (h *Client) NodeIPs(ctx context.Context, machineType machine.Type) (addrs []string, err error)

NodeIPs returns list of node IP addresses by machine type.

func (*Client) Uncordon added in v0.3.0

func (h *Client) Uncordon(ctx context.Context, name string, force bool) error

Uncordon marks a node as schedulable.

If force is set, node will be uncordoned even if cordoned not by Talos.

func (*Client) WaitUntilReady added in v0.6.0

func (h *Client) WaitUntilReady(ctx context.Context, name string) error

WaitUntilReady waits for a node to be ready.

Directories

Path Synopsis
Package kubelet provides minimal client for the kubelet API.
Package kubelet provides minimal client for the kubelet API.

Jump to

Keyboard shortcuts

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