kube

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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