kube

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigNamespace

func ConfigNamespace() (string, error)

func CreateConfigMap

func CreateConfigMap(ctx context.Context, cli kubernetes.Interface, namespace string, spec string) (*v1.ConfigMap, error)

CreateConfigMap creates a configmap set from a yaml spec.

func CreateDeployment

func CreateDeployment(ctx context.Context, cli kubernetes.Interface, namespace string, spec string) (*v1beta1.Deployment, error)

CreateDeployment creates a deployment set from a yaml spec.

func CreateStatefulSet

func CreateStatefulSet(ctx context.Context, cli kubernetes.Interface, namespace string, spec string) (*v1beta1.StatefulSet, error)

CreateStatefulSet creates a stateful set from a yaml spec.

func Exec

func Exec(cli kubernetes.Interface, namespace, pod, container string, command []string) (string, string, error)

Exec is our version of the call to `kubectl exec` that does not depend on k8s.io/kubernetes.

func ExecWithOptions

func ExecWithOptions(kubeCli kubernetes.Interface, options ExecOptions) (string, string, error)

ExecWithOptions executes a command in the specified container, returning stdout, stderr and error. `options` allowed for additional parameters to be passed.

func FetchPods

func FetchPods(cli kubernetes.Interface, namespace string, uid types.UID, labels map[string]string) ([]v1.Pod, error)

FetchPods fetches the pods matching the specified labels and owner UID

func FetchReplicaSet

func FetchReplicaSet(cli kubernetes.Interface, namespace string, uid types.UID, labels map[string]string) (*v1beta1ext.ReplicaSet, error)

FetchReplicaSet fetches the replicaset matching the specified labels and owner UID

func LoadConfig

func LoadConfig() (config *rest.Config, err error)

LoadConfig returns a kubernetes client config based on global settings.

func NewClient

func NewClient() kubernetes.Interface

NewClient returns a k8 client configured by the k10 environment.

func WaitOnDeploymentReady

func WaitOnDeploymentReady(ctx context.Context, kubeCli kubernetes.Interface, d *v1beta1.Deployment) bool

WaitOnDeploymentReady waits for the deployment to be ready

func WaitOnStatefulSetReady

func WaitOnStatefulSetReady(ctx context.Context, kubeCli kubernetes.Interface, ss *v1beta1.StatefulSet) bool

WaitOnStatefulSetReady waits for the stateful set to be ready

Types

type ExecOptions

type ExecOptions struct {
	Command []string

	Namespace     string
	PodName       string
	ContainerName string

	Stdin         io.Reader
	CaptureStdout bool
	CaptureStderr bool
}

ExecOptions passed to ExecWithOptions

type Job

type Job struct {
	// contains filtered or unexported fields
}

Job object is used for running the user specified container as a Kubernetes job.

func NewJob

func NewJob(clientset kubernetes.Interface, jobName string, namespace string, image string, command ...string) (*Job, error)

NewJob creates a new Job object.

func (*Job) Create

func (job *Job) Create() error

Create creates the Job in Kubernetes.

func (*Job) Delete

func (job *Job) Delete() error

Delete deletes the Job in Kubernetes.

func (*Job) WaitForCompletion

func (job *Job) WaitForCompletion(ctx context.Context) error

WaitForCompletion waits for the job to run to completion.

Jump to

Keyboard shortcuts

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