kube

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterNamespaces

func GetClusterNamespaces(clientset *kubernetes.Clientset) (*corev1.NamespaceList, error)

GetClusterNamespaces gets a namespace list from the cluster

func NewK8sClientSet

func NewK8sClientSet(kubeconfigPath string) (*kubernetes.Clientset, error)

NewK8sClientSet creates a k8s clientset if the kubeconfigPath is empty, it attempts to get an in-cluster client

Types

type K8sEnvRequest

type K8sEnvRequest struct {
	Artifacts []*PodData `json:"artifacts"`
	Type      string     `json:"type"`
	Id        string     `json:"id"`
}

K8sEnvRequest represents the PUT request body to be sent to kosli from k8s

type PodData

type PodData struct {
	PodName           string                  `json:"podName"`
	Namespace         string                  `json:"namespace"`
	Digests           map[string]string       `json:"digests"`
	CreationTimestamp int64                   `json:"creationTimestamp"`
	Owners            []metav1.OwnerReference `json:"owners"`
}

PodData represents the harvested pod data

func GetPodsData

func GetPodsData(includNamespaces []string, excludeNamespaces []string, clientset *kubernetes.Clientset, logger *logger.Logger) ([]*PodData, error)

GetPodsData lists pods in the target namespace(s) of a target cluster and creates a list of PodData objects for them

func NewPodData

func NewPodData(pod *corev1.Pod) *PodData

NewPodData creates a PodData object from a k8s pod

Jump to

Keyboard shortcuts

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