kubeutil

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AllNamespace when you use the  kubernetes client in go an empty string
	// means all namespace
	AllNamespace = ""
	// ProfefeEnabledAnnotation is the annotation used to discrimanate when a
	// pod has to be profiled or not.
	ProfefeEnabledAnnotation = "profefe.com/enable"
)

Variables

This section is empty.

Functions

func GetNamespaceFromKubernetesFlags

func GetNamespaceFromKubernetesFlags(
	configFlag *genericclioptions.ConfigFlags,
	rbFlags *genericclioptions.ResourceBuilderFlags) string

GetNamespaceFromKubernetesFlags returns the namespace combining the namespace flags from genericclioptions.ConfigFlags and the Allnamespace option in genericclioptions.ResourceBuilderFlags

func GetPodByName

func GetPodByName(clientset kubernetes.Interface, namespace, name string, opt metav1.GetOptions) (*v1.Pod, error)

GetPodByName returns a single pod with the profefe annotation enabled

func GetSelectedPods

func GetSelectedPods(clientset kubernetes.Interface,
	namespace string,
	listOpt metav1.ListOptions) ([]v1.Pod, error)

GetSelectedPods returns all the pods with the profefe annotation enabled filtered by the selected labels

func PortForwardAPod

func PortForwardAPod(req PortForwardAPodRequest) error

PortForwardAPod forwards the port specificed from the profefe port annotation locally.

Types

type PortForwardAPodRequest

type PortForwardAPodRequest struct {
	RestConfig *rest.Config
	Pod        v1.Pod
	LocalPort  int
	Streams    genericclioptions.IOStreams
	StopCh     <-chan struct{}
	ReadyCh    chan struct{}
}

Jump to

Keyboard shortcuts

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