Documentation ¶
Index ¶
- func GetDaemonSetPodCollections(kubeClient *kubeclient.Clientset, daemonSet *appsv1.DaemonSet, ...) (*types.PodCollections, error)
- func MonitorDaemonSetContainer(kubeClient *kubeclient.Clientset, daemonSet *appsv1.DaemonSet, ...) error
- func WaitForDaemonSetContainersExit(ctx context.Context, logger *logrus.Entry, kubeClient *kubeclient.Clientset, ...) error
- func WaitForDaemonSetContainersReady(ctx context.Context, logger *logrus.Entry, kubeClient *kubeclient.Clientset, ...) error
- type Workload
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