plugin

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamespace added in v0.0.4

func GetNamespace(configFlags *genericclioptions.ConfigFlags, all bool, givenNamespace string) (string, error)

GetNamespace will retrieve the current namespace from the provided namespace or kubeconfig file of the caller or handle the return of the all namespaces shortcut when the flag is set.

func TerminatedPodsFilter added in v0.0.4

func TerminatedPodsFilter(pods []v1.Pod) []v1.Pod

TerminatedPodsFilter is used to filter for pods that contain a terminated container, with an exit code of 137 (OOMKilled).

Types

type MemoryInfo

type MemoryInfo struct {
	Request string
	Limit   string
}

MemoryInfo is the container resource requests, specific to the memory limit and requests.

type TerminatedPodInfo

type TerminatedPodInfo struct {
	Pod            v1.Pod
	Memory         MemoryInfo
	ContainerName  string // Name of the container within the pod that was terminated, in the case of multi-container pods.
	TerminatedTime string // When the pod was terminated
	StartTime      string // When the pod was started during the termination period.
	// contains filtered or unexported fields
}

TerminatedPodInfo is a wrapper struct around an OOMKilled Pod's information.

type TerminatedPods added in v0.0.7

type TerminatedPods []TerminatedPodInfo

TerminatedPods is a wrapper type around multiple TerminatedPodInfo structs.

func BuildTerminatedPodsInfo added in v0.0.4

func BuildTerminatedPodsInfo(client *kubernetes.Clientset, namespace string) (TerminatedPods, error)

BuildTerminatedPodsInfo retrieves the terminated pod information, bundled into a slice of the informational struct.

func Run added in v0.0.4

func Run(configFlags *genericclioptions.ConfigFlags, namespace string) (TerminatedPods, error)

Run returns the pod information for those that have been OOMKilled, this provides the plugin functionality.

func (TerminatedPods) SortByTimestamp added in v0.0.7

func (t TerminatedPods) SortByTimestamp()

SortByTimestamp sorts the terminated pods slice in ascending order, in other words, it shows the first OOMKilled pod found at the top of the table and the most recent one at the end.

Jump to

Keyboard shortcuts

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