kubernetes

package
v0.0.0-...-02c6b06 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const NodeOutOfDisk = "OutOfDisk"

NodeOutOfDisk is deprecated NodeConditionType. It is no longer reported by kubelet >= 1.13. See https://github.com/kubernetes/kubernetes/pull/70111. +deprecated

Variables

This section is empty.

Functions

func CheckDaemonSet

func CheckDaemonSet(daemonSet *appsv1.DaemonSet) error

CheckDaemonSet checks whether the given DaemonSet is healthy. A DaemonSet is considered healthy if its controller observed its current revision and if its desired number of scheduled pods is equal to its updated number of scheduled pods.

func CheckDeployment

func CheckDeployment(deployment *appsv1.Deployment) error

CheckDeployment checks whether the given Deployment is healthy. A deployment is considered healthy if the controller observed its current revision and if the number of updated replicas is equal to the number of replicas.

func CheckNode

func CheckNode(node *corev1.Node) error

CheckNode checks whether the given Node is healthy. A node is considered healthy if it has a `corev1.NodeReady` condition and this condition reports `corev1.ConditionTrue`.

func CheckStatefulSet

func CheckStatefulSet(statefulSet *appsv1.StatefulSet) error

CheckStatefulSet checks whether the given StatefulSet is healthy. A StatefulSet is considered healthy if its controller observed its current revision, it is not in an update (i.e. UpdateRevision is empty) and if its current replicas are equal to its desired replicas.

func NewClientFromBytes

func NewClientFromBytes(data []byte, opts client.Options) (client.Client, error)

NewClientFromBytes creates a new client from kubeconfig.

func NewClientFromFile

func NewClientFromFile(kubeconfigPath string, opts client.Options) (client.Client, error)

NewClientFromFile creates a new Client struct from a kubconfig file.

func NewClientFromSecret

func NewClientFromSecret(ctx context.Context, c client.Client, namespace, secretName string, opts client.Options) (client.Client, error)

NewClientFromSecret creates a new Client struct for a given kubeconfig stored as a Secret in an existing Kubernetes cluster. This cluster will be accessed by the <k8sClient>. It will read the Secret <secretName> in <namespace>. The Secret must contain a field "kubeconfig" which will be used.

func NewClientFromSecretObject

func NewClientFromSecretObject(secret *corev1.Secret, opts client.Options) (client.Client, error)

NewClientFromSecretObject creates a new Client struct for a given Kubernetes Secret object. The Secret must contain a field "kubeconfig" which will be used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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