kube_apis

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Env variable key for Kubernetes node name
	POSTMAN_INSIGHTS_K8S_NODE = "POSTMAN_INSIGHTS_K8S_NODE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeClient

type KubeClient struct {
	Clientset     *kubernetes.Clientset
	PodEventWatch *watchTool.RetryWatcher
	AgentNode     string
	AgentHost     string
}

KubeClient struct holds the Kubernetes clientset and event watcher

func NewKubeClient

func NewKubeClient() (KubeClient, error)

NewKubeClient initializes a new Kubernetes client

func (*KubeClient) Close

func (kc *KubeClient) Close()

Close stops the event watcher

func (*KubeClient) FilterPodsByContainerImage

func (kc *KubeClient) FilterPodsByContainerImage(pods []coreV1.Pod, containerImage string, negate bool) ([]coreV1.Pod, error)

FilterPodsByContainerImage filters a list of pods by the container image name

func (*KubeClient) GetContainerUUIDs added in v0.35.0

func (kc *KubeClient) GetContainerUUIDs(pod coreV1.Pod) ([]string, error)

GetContainerUUIDs returns the UUIDs of all containers in a given pod

func (*KubeClient) GetPodsByUIDs

func (kc *KubeClient) GetPodsByUIDs(podUIDs []types.UID) ([]coreV1.Pod, error)

GetPods returns a list of pods running on the agent node with the given names

func (*KubeClient) GetPodsInAgentNode

func (kc *KubeClient) GetPodsInAgentNode() ([]coreV1.Pod, error)

GetPodsInNode returns the names of all pods running in a given node

func (*KubeClient) GetPodsStatusByUIDs

func (kc *KubeClient) GetPodsStatusByUIDs(podUIDs []types.UID) (maps.Map[types.UID, coreV1.PodPhase], error)

GetPodsStatus returns the statuses for list of pods

Jump to

Keyboard shortcuts

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