kubectl

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2018 License: Apache-2.0 Imports: 24 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 DescribePod added in v0.2.0

func DescribePod(namespace, name string) (string, error)

DescribePod returns a desription string of a pod (internally calls the kubectl describe function)

func Exec

func Exec(kubectlClient *kubernetes.Clientset, pod *k8sv1.Pod, container string, command []string, tty bool, errorChannel chan<- error) (io.WriteCloser, io.ReadCloser, io.ReadCloser, error)

Exec executes a command for kubectl

func ExecBuffered

func ExecBuffered(kubectlClient *kubernetes.Clientset, pod *k8sv1.Pod, container string, command []string) ([]byte, []byte, error)

ExecBuffered executes a command for kubernetes and returns the output and error buffers

func ForwardPorts

func ForwardPorts(kubectlClient *kubernetes.Clientset, pod *k8sv1.Pod, ports []string, stopChan chan struct{}, readyChan chan struct{}) error

ForwardPorts forwards the specified ports from the cluster to the local machine

func GetClientConfig

func GetClientConfig() (*rest.Config, error)

GetClientConfig loads the configuration for kubernetes clients and parses it to *rest.Config

func GetFirstRunningPod added in v1.0.0

func GetFirstRunningPod(kubectl *kubernetes.Clientset, labelSelector, namespace string) (*k8sv1.Pod, error)

GetFirstRunningPod retrieves the first pod that is found that has the status "Running" using the label selector string

func GetPodStatus added in v0.2.0

func GetPodStatus(pod *k8sv1.Pod) string

GetPodStatus returns the pod status as a string Taken from https://github.com/kubernetes/kubernetes/pkg/printers/internalversion/printers.go

func GetPodsFromDeployment added in v0.2.0

func GetPodsFromDeployment(kubectl *kubernetes.Clientset, deployment, namespace string) (*k8sv1.PodList, error)

GetPodsFromDeployment retrieves all found pods from a deployment name

func NewClient

func NewClient() (*kubernetes.Clientset, error)

NewClient creates a new kubernetes client

Types

This section is empty.

Jump to

Keyboard shortcuts

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