kubernetes

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDaemonSetPodCollections

func GetDaemonSetPodCollections(kubeClient *kubeclient.Clientset, daemonSet *appsv1.DaemonSet, containerName string, addPrefix, onlyFailed bool, tailLines *int64) (*types.PodCollections, error)

GetDaemonSetPodCollections retrieves the logs of the specified container within the given DaemonSet. Optionally, it can: - add prefixes to the log lines - only retrieve logs of failed containers - retrieve the last N lines of the logs

func MonitorDaemonSetContainer

func MonitorDaemonSetContainer(kubeClient *kubeclient.Clientset, daemonSet *appsv1.DaemonSet, containerName string, conditionFunc monitorDaemonSetContainerConditionFunc, maxConditionToleration *int) error

MonitorDaemonSetContainer monitors the specified container within the given DaemonSet until a certain condition is met. The condition is defined by the monitorDaemonSetContainerConditionFunc. Returns nil on success, or an error if the condition check fails or the timeout is reached.

func WaitForDaemonSetContainersExit

func WaitForDaemonSetContainersExit(ctx context.Context, logger *logrus.Entry, kubeClient *kubeclient.Clientset, daemonSet *appsv1.DaemonSet, containerName string, maxConditionToleration *int) error

WaitForDaemonSetContainersExit waits for the containers in the given DaemonSet to exit.

func WaitForDaemonSetContainersReady

func WaitForDaemonSetContainersReady(ctx context.Context, logger *logrus.Entry, kubeClient *kubeclient.Clientset, daemonSet *appsv1.DaemonSet, containerName string, maxConditionToleration *int) error

WaitForDaemonSetContainersReady waits for the containers in the given DaemonSet to be ready.

Types

type Workload

type Workload struct {
	KubeClient *kubeclient.Clientset

	Kind      string
	Namespace string
	Name      string

	// Selector is used to filter pods.
	// For example, to filter pod with label app=foo, use the selector "app=foo".
	// For multiple selectors, use "app=foo,app=bar".
	LabelSelectors string
	// contains filtered or unexported fields
}

Workload provide functions for workloads.

func NewWorkload

func NewWorkload(kubeClient *kubeclient.Clientset, obj interface{}, kind, labelSelector string) (*Workload, error)

NewWorkload returns a new Workload.

func (*Workload) GetPodsLogByContainer

func (obj *Workload) GetPodsLogByContainer(ctx context.Context, logger *logrus.Entry, containerName string, addPrefix, onlyFailed bool, tailLines *int64) (*types.PodCollections, error)

GetPodsLogByContainer retrieves logs of the specified container. within the given pods. Optionally, it can: - add prefixes to the log lines - only retrieve logs of failed containers - retrieve the last N lines of the logs

func (*Workload) WaitForPodContainerRunning

func (obj *Workload) WaitForPodContainerRunning(ctx context.Context, containerName string) error

WaitForPodContainerRunning waits for a pod container to be running.

Jump to

Keyboard shortcuts

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