kube

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterEvents

func FilterEvents(events []corev1.Event, resourceKind, resourceName string, podNames []string) ([]corev1.Event, []corev1.Event)

FilterEvents filters events for a given resource kind/name and optional pod names.

func FilterLogs added in v0.6.0

func FilterLogs(logString string, logTail int, logRegex string) string

filter logs provides advanced filtering for logs based on regex, log tail

func GetClient

func GetClient() (kubernetes.Interface, error)

func GetDeploymentPods

func GetDeploymentPods(client kubernetes.Interface, namespace string, deploy *appsv1.Deployment) ([]corev1.Pod, error)

GetDeploymentPods returns the pods managed by a given deployment.

func ListAllEventsInNamespace

func ListAllEventsInNamespace(client kubernetes.Interface, namespace string) ([]corev1.Event, error)

ListAllEventsInNamespace fetches all events in the given namespace.

Types

type ContainerLog

type ContainerLog struct {
	PodName       string
	ContainerName string
	Logs          string
}

ContainerLog holds logs for a single container.

func FetchPodLogs

func FetchPodLogs(client kubernetes.Interface, namespace string, pod corev1.Pod, tailLines int) ([]ContainerLog, error)

FetchPodLogs retrieves logs for all containers in a given pod.

type ResourceData

type ResourceData struct {
	Kind string
	Obj  interface{}
}

ResourceData is a simple struct that can hold the retrieved object and its kind.

func FetchResource

func FetchResource(client kubernetes.Interface, namespace, resourceType, resourceName string) (*ResourceData, error)

Jump to

Keyboard shortcuts

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