controller

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPodMetadataAndSpec added in v0.3.2

func GetPodMetadataAndSpec(obj map[string]any) (*metav1.ObjectMeta, *corev1.PodSpec, error)

GetPodMetadataAndSpec looks inside arbitrary YAML for a PodSpec and it's metadata

Types

type Client added in v0.3.0

type Client struct {
	Context    context.Context
	Dynamic    dynamic.Interface
	RESTMapper meta.RESTMapper
}

Client is used to interact with the Kubernetes API

func (Client) GetAllPersistentVolumeClaims added in v0.3.1

func (client Client) GetAllPersistentVolumeClaims(namespace string) ([]unstructured.Unstructured, error)

GetAllPersistentVolumeClaims returns all PVCs as unstructured objects.

func (Client) GetAllTopControllersSummary added in v0.3.0

func (client Client) GetAllTopControllersSummary(namespace string) ([]Workload, error)

GetAllTopControllersSummary returns the highest level owning object of all pods If a namespace is provided than this is limited to that namespace. This can be more memory-efficient than GetAllTopControllersWithPods, since it does not include individual pods.

func (Client) GetAllTopControllersWithPods added in v0.3.0

func (client Client) GetAllTopControllersWithPods(namespace string) ([]Workload, error)

GetAllTopControllersWithPods returns the highest level owning object of all pods, as well as all pods. If a namespace is provided than this is limited to that namespace.

func (Client) GetTopController added in v0.3.0

func (client Client) GetTopController(unstructuredObject unstructured.Unstructured, objectCache map[string]unstructured.Unstructured) (unstructured.Unstructured, error)

GetTopController finds the highest level owner of whatever object is passed in.

type Workload

type Workload struct {
	TopController   unstructured.Unstructured
	Pods            []unstructured.Unstructured
	PodSpec         *corev1.PodSpec
	PodMetadata     *metav1.ObjectMeta
	PodCount        int
	RunningPodCount int
}

Workload represents a workload in the cluster. It contains the top level object and all of the pods.

Jump to

Keyboard shortcuts

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