kubernetes

package
v1.14.6 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MPL-2.0 Imports: 31 Imported by: 1 module, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 VersionFromImageRef added in v1.14.0

func VersionFromImageRef(image string) (string, bool)

VersionFromImageRef extracts the tag out of the image reference, ignoring the digest (if present).

It returns false if the reference can't be parsed or if the tag is missing.

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