kubernetes

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

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

GetClient creates a new kubernetes client with the kubeconfig at ~/.kube/config

func GetRestConfig

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

GetRestConfig returns a new rest.Config based on the kubeconfig at ~/.kube/config

func WaitForPodComplete

func WaitForPodComplete(ctx context.Context, clientset *kubernetes.Clientset, namespace, podName string, finish chan bool) error

WaitForPodComplete waits for a specific pod to be in complete state

func WaitForPodInitialized

func WaitForPodInitialized(ctx context.Context, clientset *kubernetes.Clientset, namespace, podName string) error

WaitForPodInitialized waits for a specific pod to be initialized

Types

type Copy

type Copy struct {
	Namespace string
	PodName   string
	Container string
	SrcPath   string
	DestPath  string
}

Copy contains all required information to copy a file into a pod

func (Copy) CopyFileIntoPod

func (c Copy) CopyFileIntoPod(client *kubernetes.Clientset) error

CopyFileIntoPod copies the src .tar.gz into the specified container

type Exec

type Exec struct {
	Namespace string
	PodName   string
	Container string

	Command []string
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
}

Exec contains all required information to execute a command in a container

func (Exec) Exec

func (e Exec) Exec(client *kubernetes.Clientset) error

Exec executes a command in the specified container and opens a websocket stream if needed for Stdin

Jump to

Keyboard shortcuts

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