kubernetes

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 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

func IsRetryableError(err error) bool

IsRetryableError returns true if this Kubernetes API should be retried.

func VersionGTE added in v1.8.0

func VersionGTE(image string, version semver.Version) bool

VersionGTE returns true if the version of the image is greater than or equal to the provided version.

It supports any kind of image reference, but requires the tag to be present.

Types

type Client

type Client struct {
	*taloskubernetes.Client
}

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

func NewClientFromKubeletKubeconfig

func NewClientFromKubeletKubeconfig() (*Client, error)

NewClientFromKubeletKubeconfig initializes and returns a Client.

func NewClientFromPKI

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

NewClientFromPKI initializes and returns a Client.

func NewForConfig

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

NewForConfig initializes and returns a client using the provided config.

func NewTemporaryClientControlPlane added in v1.3.2

func NewTemporaryClientControlPlane(ctx context.Context, r controller.Reader) (client *Client, err error)

NewTemporaryClientControlPlane initializes a Kubernetes client for a controlplane node using PKI information.

The client uses "localhost" endpoint, so it doesn't depend on the loadbalancer to be ready.

func NewTemporaryClientFromPKI

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) Drain

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

Drain evicts all pods on a given node.

func (*Client) NodeIPs

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

NodeIPs returns list of node IP addresses by machine type.

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